|
|||||||
|
Rods
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 n rods with very short diameters and lengths li (1 <= li <= 100000) were used to verify this property, and while being heated they lengthened respectively by di (1 <= di <= 100), where di <= li / 2. As a unit we take one millimeter. TaskWrite a program that:
InputIn the first line of the text file PRE.IN there is written one positive integer n <= 50000.In each of the following n lines there are written two integers separated by a single space – the original length of the rod li and its increase in length during heating di. OutputIn each of n lines of the text file PRE.OUT there should be written one nonnegative integer. The integer in i-th line should be equal to the distance between the positions of the middle of the i-th rod before and after heating computed with a required accuracy (0,5 at unit).ExampleFor the input file PRE.IN:2 1000 20 15000 10 the correct answer is the output file PRE.OUT: Your program should look for the file PRE.IN in the current directory and produce the output file PRE.OUT in the current directory too. The file containing the source code of your program should have a name PRE.???, whereas you should put three-letter abbreviation of the used programming language name instead of ???. The same program in executable form should be written in the file PRE.EXE |