Problem Statement  
You are given a int[] X containing the xcoordinates of several points. Each point starts at an infinitely high ycoordinate. Starting with the first point, each point falls down until it is either a distance of R away from a previously fallen point or it reaches y = 0. Each point (after the first point) will start falling only when the previous one stops. Return a double[], where the ith element is the final ycoordinate of the ith point.  
Definition  
 
Notes  
  Each element of your return value must have an absolute or relative error less than 1e9.  
Constraints  
  X will contain between 1 and 50 elements, inclusive.  
  All elements of X will be between 0 and 1,000, inclusive.  
  R will be between 1 and 1,000, inclusive.  
Examples  
0)  
 
1)  
 
2)  
 
3)  
