Adventures in Moving - Part V
Time limit1sMemory limit128 MB
Decide whether a rectangular box can pass through a height-limited doorway and rest flat on the floor against the front wall of a van.
- Level
Medium7 of 10
- Topics
- Geometry, Math, Implementation, Brute force
- Solved
- No attempts yet
Problem
To save money, you are thinking about renting a small cube van to move your belongings to the Big City. The inside of the van is a rectangular box with width , height , and length . The van has a sliding door at the back that only lifts to height (with ), so there is a fixed overhang of height at the top of the doorway.
You have one large rectangular box that you want to load onto the van. You can load it only if all of the following are satisfied:
- The box fits through the doorway, tilting it forward or sideways (but not both) if necessary.
- The box is placed with one face flat on the floor.
- The box is placed with one face flat against the front wall.
- The door can be closed once the box is in place.
You may assume there are no obstructions outside the van (such as a ceiling or the ground) that would interfere with loading.
Input
The input contains several test cases. Each test case is given on two lines. The first line contains four integers , , , and . The second line contains three integers: the three side lengths of the box. The input continues until end of file.
Output
For each test case, print The box goes on the truck. if the box can be loaded onto the van; otherwise print The box will not go on the truck. Each test case starts with an empty van.