Alice teaches privately, and preparing the material is part of her job. Right now she is drawing a Venn diagram of two sets A and B.
A Venn diagram shows how sets relate to one another. In a Venn diagram of A and B, the outer rectangle is the universal set U, and the two circles inside it are A and B. The region where the circles overlap corresponds to the intersection A∩B.
Alice wants the picture to carry the numbers too, so she imposed a condition: the area of every region must equal the number of elements of the set that region stands for. One circle has area ∣A∣, the other has area ∣B∣, and the overlap of the two circles has area ∣A∩B∣. Here ∣X∣ is the number of elements of a set X.
The rectangle is already drawn. Its lower left corner is (0,0) and its upper right corner is (UW,UH). Both circles have to lie inside that rectangle. Write a program that computes the centre and the radius of each circle.
The input holds several datasets. There are at most 300 of them. Each dataset is one line with five integers.
UW UH |A| |B| |A∩B|
UW and UH (1≤UW,UH≤100) are the width and the height of the rectangle that stands for the universal set U. ∣A∣, ∣B∣ and ∣A∩B∣ (1≤∣A∣,∣B∣≤10000, 0≤∣A∩B∣≤min(∣A∣,∣B∣)) are the numbers of elements of A, B and A∩B. The last line holds five zeroes and is not a dataset.
Whether the two circles can be drawn does not change when UW and UH move by up to 0.01 in either direction.
Print one line for each dataset. Many placements satisfy Alice's condition, so print the single placement that the rule below picks out.
The radii follow from the areas: RA=∣A∣/π and RB=∣B∣/π.
Let d be the smallest distance between the two centres at which the overlap area equals ∣A∩B∣. If ∣A∩B∣=0, then d=RA+RB. If ∣A∩B∣=min(∣A∣,∣B∣), then d=0. Otherwise exactly one d with ∣RA−RB∣<d<RA+RB gives that overlap area.
The two circles can be drawn exactly when both of the following hold.
If either one fails, print impossible.
Otherwise let s=d/D, and let s=0 when D=0. Print the six values
in that order, on one line, separated by single spaces, each with exactly nine digits after the decimal point. In words: the centre of circle A lies on the segment from the centre of the rectangle to the point (RA,RA), the centre of circle B lies on the segment from the centre of the rectangle to the point (UW−RB,UH−RB), and both centres sit the same fraction s of the way along their own segment.