ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

Ural Regional School Programming Contest 2010

About     Problems     Submit solution     Judge status     Standings
Contest is over

I. Tray 2

Time limit: 1.0 second
Memory limit: 64 MB
One of the organizers of the Ural Regional School Programming Contest came to the university cafeteria to have lunch. He took a soup and a main course and tried to arrange them on a small rectangular tray, which was not so easy. “Oops, that's a problem,” he thought. “Oh, yes, that's a problem! A nice problem for the contest!”
The Ural State University's cafeteria has trays with a rectangular a × b bottom and vertical borders of height d. Plates have the shape of a truncated cone. All the plates in the cafeteria have the same height h. The organizer wants to put the plates on the tray so that their bottoms adjoin the bottom of the tray completely. Can he do it?
Problem illustration


The first line contains the integers a, b, and d separated with a space. Each of the following lines describes one of the plates and contains two integers. The former integer is the radius of the plate's bottom and the latter integer is the radius of the circle formed by the edge of the plate. The second radius is greater than the first one. The last line contains the height h of the plates. All the input integers are positive and do not exceed 1000.


Output “YES” if the plates can be arranged on the tray and “NO” otherwise.


10 10 10
1 2
1 2
8 4 1
1 2
1 3
Problem Author: Sofia Tekhazheva
Problem Source: Ural Regional School Programming Contest 2010
To submit the solution for this problem go to the Problem set: 1793. Tray 2