The astronomers
have long since learned how to forecast solar eclipses for many years ahead.
They use the classic laws of celestial mechanics which need practically no
corrections. Some of the important characteristics of a solar eclipse are its
start and end times, maximum phase and obscuration.
The start of the
eclipse is the moment when Moon's and Sun's visible disks touch.
The end of the
eclipse is the moment when the disks do not intersect anymore.
Maximum phase is
the moment of the maximum intersection of the disks.
Eclipse obscuration
is the fraction of the Sun's area occulted by Moon during the maximum phase.
Total solar eclipse corresponds to the obscuration of 100%.
It is known that
visible Sun's and Moon's disks are of equal size when observed from the Earth.
Write a program
that will determine the characteristics of a solar eclipse using the
information about Sun's and Moon's movement.
The information
is based on the star map, which is considered to be a rectangle in the
Cartesian system (for the sake of simplicity). Sun's and Moon's disks are
circles of unit radius. The movement of the celestial bodies is described with
equations defining the paths of their centers. Linear equations are used. For
both the Sun and the Moon they are in the form:

where x and y
are the coordinates of the point at the moment t. Constants A,
B, C, D are specific for each celestial body.
For short time
frames this model produces satisfactory results.
It is thought that the eclipse will start
in the time interval (0 <= t <= 1000). If the eclipse does not start in
this interval then the obscuration is equal to zero.
Limitations
–100 <= As,
Bs, Cs, Ds, Am, Bm,
Cm, Dm <= 100;
Sun’s and Moon’s
pathways are non-parallel.
Input (Standard input)
The first line
specifies four space-delimited real numbers that describe the movement of the
Sun's disk: As Bs Cs Ds are coefficients in the equations (*)
The second line specifies four
space-delimited real numbers that describe the movement of the Moon's disk: Am
Bm Cm Dm .
Output (Standard output)
The first line must contain the
obscurity of the eclipse (in %, 0.01 precision). If this value is non-zero,
then the second line must contain three numbers separated by a whitespace:
start time, end time and the maximum phase of the eclipse (precisions are 0.0001).
Note: use dot «.» as decimal separator.
Sample
Standard input
|
Standard output
|
1 0 1 0
1 0 -1
10
|
100.00
4.0000
6.0000 5.0000
|
1 0 1
-5.3
2 1 0.5
1.1
|
0.00
|