Under construction

Still being built. Things may change

Too Much Water

Interview

Time limit1sMemory limit128 MB

Summary
Given a property point, compute the hour when the growing semicircle centered at the origin first covers it, using the fixed 50 square meters per hour rate.
Level

Easy3 of 10

Topics
Geometry, Math, Binary search, Implementation
Solved
No attempts yet

Problem

Fred Mapper is a real estate agent in Prague. Many foreign delegates attending the NATO Summit ask him to find a house to rent during their stay in Prague, and some plan to stay for a longer time even after the Summit ends. Unfortunately, many of them saw pictures on TV of the floods that happened in August, and they are afraid of water.

Many of Fred's properties are located in Kampa. While investigating the August data, he learned that during a flood the water covers exactly 5050 square meters each hour. We now need to determine how much time is available for evacuation at any given point.

After further research, Fred learned that the flooded land forms a semicircle. This semicircle is the part of a circle centered at (0,0)(0,0) that lies above the x-axis, which bisects the circle. Locations below the x-axis are in the river. The semicircle has area 00 at the beginning of hour 11 (when the flood begins), as illustrated in the figure.

Input

The input consists of several property descriptions. Each property is described by one line containing two numbers XX and YY, the Cartesian coordinates of the property. XX and YY are floating-point numbers measured in meters, given with one digit after the decimal point, with −1000≤X≤1000-1000 \le X \le 1000 and 0≤Y≤10000 \le Y \le 1000.

The point (0,0)(0,0) is never given as a property, except on the last line, where two zeros terminate the input. This last line must not be processed.

Output

For each property, print a single line of the form "The property will be flooded in hour Z.", where ZZ is the first hour (counted from 11) at the end of which this property lies within the semicircle. ZZ must be an integer. No property lies exactly on the semicircle boundary at the end of any hour; it is always either strictly inside or strictly outside.

Examples2

  1. Example 1

    Input
    1.0 1.0
    25.0 0.0
    0 0
    
    Expected output
    The property will be flooded in hour 1.
    The property will be flooded in hour 20.
    
  2. Example 2

    Input
    0.1 0.0
    0 0
    
    Expected output
    The property will be flooded in hour 1.