ECLIPSE - Eclipse

Every so often we hear on the news that there is going to be either a solar or lunar eclipse. Eclipses have a long history dating back well into the BC’s. Astronomers study total solar eclipses very closely as they provide the rare opportunity to observe the corona.

An eclipse occurs when two celestial bodies and a star are (nearly) linearly aligned and the shadow cast by the one body intersects the other body, creating darkness on the latter body.

We are interested in determining when a solar eclipse will next occur. In Figure 1 you can see two labelled regions. The umbra is the area of total darkness — a body in this region will experience a total solar eclipse. The penumbra is the area of partial darkness — a body in this region will experience a partial solar eclipse.

You will be given the size and location of a star and two celestial bodies. Your task is to determine if the first celestial body creates a solar eclipse on the second celestial body. If it does then you are to determine whether it is a total or partial eclipse and whether the entire body is in eclipse. If part of the body is experiencing total eclipse while the entire body is experiencing at least a partial eclipse, we are only interested in the part that is in total eclipse.

Consider a scaled model of our solar system with the sun at the origin (0, 0, 0) with radius 700, the moon at position (49900, 1000, 149700) with radius 2 and Earth at position (50000, 1000, 150000) with radius 7. In Figure 1, the sun would be the star on the left and the moon would be the smaller body on the right. Part of Earth would then fall in the black umbra region and hence partly experience a total solar eclipse.

For any body:

  • 1 ≤ r ≤ 106
  • 0 ≤ x, y, z ≤ 109

It is guaranteed that any two bodies will be at least 1 unit apart, and that moving any one of the bodies by 1 unit (in any direction) will not change the answer.

Input

A test case is described by three lines, each describing the size and location of a single body. The first line contains four space-separated integers xs, ys, zs and rs , describing the center (xs, ys, zs) and radius rs of the star. The following two lines define the two celestial bodies in the same manner.

Test cases follow directly after one another with a −1 representing the end of the test cases.

Output

Each test case has a single line of output describing the type of eclipse for that case. If the second celestial body listed in the test case is experiencing an eclipse, then one of the following lines must be output:

  • Entire total solar eclipse
  • Part total solar eclipse
  • Entire partial solar eclipse
  • Part partial solar eclipse

If there is no solar eclipse, the line “No solar eclipse” must be output.

Example

Input:
0 0 0 700
49900 1000 149700 2
50000 1000 150000 7
0 0 0 10
50 0 100 40
60 0 200 1
-1

Output:
Part total solar eclipse
Entire total solar eclipse

Added by:Marco Gallotta
Date:2008-08-27
Time limit:30s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS-RHINO NODEJS PERL6 VB.NET
Resource:ACM Southern African Regionals 2007

hide comments
2022-09-01 10:46:23 [Rampage] Blue.Mary
No need to use integer arithmetic. C++ double type (with error bound 1e-10) is enough for solving this problem.
2016-05-04 19:27:52 Branfili
What about antumbra (after the lines of umbra intersect)?
Does it count as partial or total solar eclipse?
2016-05-03 23:34:36 Amaterasu
"It is guaranteed that any two bodies will be at least 1 unit apart..." does this mean that their centers will be at least 1 unit appart, or distance between 2 centers will be at least sum of their radius + 1(i.e. they will not intersect)?
2012-04-21 22:59:37 :D
Finally done it. Problem seems to require integer arithmetics to get AC.
2010-12-02 02:40:54 LeppyR64
total solar eclipse = planet at least partially in umbra
partial solar eclipe = planet at least partially in penumbra
Entire = planet entirely in that area
Part = planet at least partially in that area
2010-11-27 02:53:11 zetro
i get it..
hopefully get AC..........
2009-06-30 12:24:01 Marco Gallotta
Alex: in such a case your program should output "Part total".
2009-06-08 15:30:45 alind
"If part of the body is experiencing total eclipse while the entire body is experiencing at least a partial eclipse, we are only interested in the part that is in total eclipse. "

How does this differ from "Part total" while also "Part partial"?

This sounds to me like if we have "Part total" but not "Entire partial" it does not count as "Part total", which I assume is not the case?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.