Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 1106
FatMouse's Coffer

Time Limit: 2 Seconds      Memory Limit: 65536 KB

To safely store his favorite food, cheese, FatMouse has bought a coffer. The interior of the coffer is a rectangular box with width w, height h, and length l. The box has a door with only the height H. That is, there is an immovable overhang of height H-h at the top of the door.

FatMouse has a large rectangular block of cheese that he wishes to hide in the coffer. Can he get it in the coffer subject to the following constraints:

  • The cheese must fit through the door, tilting it forward or sideways (but not both) as necessary (see figure below).
  • The cheese must be placed with one side flat against the floor.
  • The cheese must be placed with one side flat against the front wall.
  • The door must close once the cheese is in place.
You may assume there are no obstructions (such as a ceiling or the ground) outside the coffer that might interfere with loading.

Input Specification

There are several test cases, each represented by two lines of input. The first line of each contains 4 integers: w, h, l, H. The next line contains 3 integers - the dimensions of the box.

Output Specification

For each test case, print "The cheese goes in the coffer." if it is possible to load the cheese in the coffer; otherwise print "The cheese will not go in the coffer." You may assume that you start with an empty coffer for each test case.

Sample Input

8 8 12 7
8 12 8
8 8 12 7
7 12 8
8 8 12 7
1 7 13
100 200 99 190
100 195 30

Output for Sample Input

The cheese will not go in the coffer.
The cheese goes in the coffer.
The cheese will not go in the coffer.
The cheese goes in the coffer.

Source: Zhejiang University Training Contest 2001
Submit    Status