当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
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”.
0 0 0 6.371e3 1.027e8 4.400e8 7.548e8 6.96e5 3.489e9 -1.036e10 -5.249e9
Yes
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.
时间上限 | 内存上限 |
1000 | 131072 |