Cones
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
n cones are given in the space. No two cones have common points. The bases of the cones lie in one plane, and the cones themselves lie on one side of this plane. You can connect the cone apex with segments, if and only if these segments do not have common points with the cones.
Input
The first line contains the number n (1 ≤ n ≤ 300). Then n rows with four numbers x_i, y_i, r_i, h_i are given — the coordinates of the base center of the cone, base radius and the height of the cone. All numbers are integers (-500 ≤ x_i, y_i ≤ 500, 1 ≤ r_i ≤ 100, 1 ≤ h_i ≤ 100).
Output
Print one number - the minimal number of segments you can reach the n-th cone, if started from the first.
Examples
Input #1
Answer #1
Submissions 330
Acceptance rate 3%