eolymp
bolt
Try our new interface for solving problems
Problems

Garden of the Permian

Garden of the Permian

\includegraphics{https://static.e-olymp.com/content/ae/ae1f8629dc8c9f3e20ae5dcc7581b86140e43776.jpg} Greenhouse "Garden of the Permian period" is a rectangular area for growing plants of the Permian period. The greenhouse was divided into squares tracks. In the center of each square planted one plant. The size depends on the square root of the plant. During the year the track overgrown with grass, making it difficult to care for the greenhouse. To work in the garden not to damage the root system of a plant at the existing location of the plant to restore the size of the corresponding squares. We introduce a rectangular Cartesian coordinate system whose origin is combined with the left lower corner greenhouse. \textbf{Ox} axis is directed along the lower border of the plot, the axis \textbf{Oy} - along the left. Initially, the tracks were laid parallel to the coordinate axes. The unit interval was chosen so that the coordinates of the corners of each square were intact. Required to write a program that the size of the greenhouse and the plants will determine the size of the coordinates of the corresponding squares. \InputFile The first line of the input file contains three positive integers: \textbf{W} -- width of the greenhouse, \textbf{H} -- the length of the greenhouse and \textbf{N} -- the number of planted trees. In each of the following \textbf{N} lines are located at two numbers: \textbf{x_i}, \textbf{y_i} -- the coordinates of the \textbf{i}^th plant (\textbf{0} < \textbf{x_i} < \textbf{W}, \textbf{0} < \textbf{y_i} < \textbf{H}; \textbf{W}, \textbf{H} ≤ \textbf{10^12}; \textbf{N} ≤ \textbf{2}×\textbf{10^5}). It is guaranteed that the corresponding squares of the plants have an entire length of the side and cover the entire greenhouse. \OutputFile The output file must take \textbf{N} integers - the size of the squares of the plants. The numbers in the order you want to display the description of plants in the input file. \Note Greenhouse in the second example corresponds to the following figure \includegraphics{https://static.e-olymp.com/content/7a/7a5e75278a67275c5262cf68396e83d25f660c67.jpg}
Time limit 1 second
Memory limit 256 MiB
Input example #1
7 7 1
3.5 3.5
Output example #1
7
Source XXIII National Olympiad in Informatics, Perm, Second Round, 04/15/2011