Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
Statistical Charts
Submit Problem
Online Status
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Illuminated Planet
Time Limit: 1000MSMemory Limit: 131072K
Total Submissions: 343Accepted: 97


A space probe is on a mission to observe a planetary system. It is instructed to shoot images of a planet, which orbits a star, using its optical camera. To ensure image quality, it must take the images only when a positive portion of the planet’s surface illuminated by the star is visible.

Given the positions and radii of the planet and the star, and the position of the space probe, determine whether images can be taken in this setting. You do not have to consider the situation that the planet is occulted by the star.


The input contains a single test case. The first line contains four numbers (x, y, z) and r, the Cartesian coordinates of the planet and its radius. The second line contains four numbers (x, y, z) and r, the Cartesian coordinates of the star and its radius. The third line contains three numbers (x, y, z), the Cartesian coordinates of the space probe. The input is physically consistent.


If images can be taken, print “Yes”; otherwise, print “No”.

Sample Input

0 0 0 6.371e3
1.027e8 4.400e8 7.548e8 6.96e5
3.489e9 -1.036e10 -5.249e9

Sample Output



The sample uses the real physical setting of Earth, the Sun and the Voyager 2 space probe. Voyager 2 is located far south to the ecliptic and thus always has the illuminated side of Earth within its sight.


[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator