W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem [email protected].
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, zapraszamy na serwery Discord. Są one moderowane przez społeczność, ale członkowie zespołu technicznego też są tam aktywni.
In laboratories of a certain company a new material called politoksyparen is tested. During the researches an interesting property has been discovered. A simple rod made of this material after being heated lengthens and bends so that it changes into an circular arc based on a chord, which is the shape of the rod at the beginning (this property concerns only rods of short diameters). Let's assume that rods with very short diameters and lengths () were used to verify this property, and while being heated they lengthened respectively by (), where . As a unit we take one millimeter.
Write a program that:
In the first line of the standard input there is written one positive integer (). In each of the following lines there are written two integers separated by a single space — the original length of the rod and its increase in length during heating .
In each of lines of the standard output there should be written one nonnegative integer. The integer in -th line should be equal to the distance between the positions of the middle of the -th rod before and after heating computed with a required accuracy.
For the input data:
2 1000 20 15000 10
the correct result is:
87 237
Task author: Piotr Chrzastowski-Wachtel.