acmsguru |
---|
Finished |
n x1 y1 z1 ... xn yn zn sx sy sz dx dy dzn is the number of cubes of a colony (1 ≤ n ≤ 16). (xi,yi,zi) represents the coordinates of the center of the i-th cube, where each coordinate value is guaranteed to be a multiple of 100 (i.e. the edge length of the cubes). (sx,sy,sz) and (dx,dy,dz) represent the robot's present point and the next repair point respectively. You may assume that these two points are always different and that neither of them lies on any edge. All coordinate values are integers between -2000 and 2000 inclusive.
sample input | sample output |
1 0 0 0 0 0 50 30 40 50 | 50.0 |
sample input | sample output |
1 0 0 0 50 0 0 0 50 0 | 100.0 |
sample input | sample output |
2 0 0 0 100 0 0 0 0 50 100 0 50 | 100.0 |
sample input | sample output |
3 0 0 0 100 0 0 0 100 0 100 50 0 50 100 0 | 100.0 |
sample input | sample output |
7 0 0 0 100 0 0 -100 0 0 0 100 0 0 -100 0 0 0 100 0 0 -100 150 0 0 -150 0 0 | 416.2277660168 |
sample input | sample output |
6 0 0 0 100 0 0 0 100 0 100 100 0 0 0 100 100 100 100 100 0 50 0 100 50 | 141.4213562373 |
sample input | sample output |
6 0 0 0 100 0 0 0 100 0 100 100 0 0 0 100 100 100 100 100 100 150 0 0 150 | 316.2277660168 |
sample input | sample output |
6 0 0 0 100 0 0 0 100 0 100 100 100 100 0 100 0 100 100 0 0 50 100 100 50 | 341.4213562373 |
sample input | sample output |
8 0 0 0 -100 0 0 -100 100 0 -100 200 0 0 200 0 100 200 0 100 200 100 100 100 100 0 0 50 100 100 50 | 341.4213562373 |
Name |
---|