当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2468:Adventures in Moving - Part V

题目描述
To save money you are considering renting a small cube van to transport your belongings to the Big City. The interior of the van is a rectangular box with width w, height h, and length l. The box has a sliding door that lifts but only to height H. That is, there is an immovable overhang of height H-h at the top of the door.
You have a large rectangular box that you wish to load on the truck. Can you get it on the truck subject to the following constraints:
  • The box must fit through the door, tilting it forward or sideways (but not both) as necessary (see figure below).
  • The box must be placed with one side flat against the floor.
  • The box must be placed with one side flat against the front wall.
  • The door must close once the box is in place.

You may assume there are no obstructions (such as a ceiling or the ground) outside the truck that might interfere with loading.
输入解释
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.
输出解释
For each test case, print "The box goes on the truck." if it is possible to load the box on the truck; otherwise print "The box will not go on the truck." You may assume that you start with an empty truck for each test case.
输入样例
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
输出样例
The box will not go on the truck.
The box goes on the truck.
The box will not go on the truck.
The box goes on the truck.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2468

最后修改于 2020-10-29T06:33:14+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536