10283_MoversProblems

2022-5-16 18:16| 发布者: Hocassian| 查看: 58| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504728308900-Problem List-采集的数据-后羿采集器.html

Pro.ID

10283

Title

Movers Problems

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10283

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 10000/5000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    The manager in charge of a large warehouse is expecting a large number of boxes to be delivered for storage.

    The warehouse has the form of a rectangle with the bottom left corner at (0, 0) and the top right corner at (Depth, Frontage). There are walls on three sides with the left side (the one along the y-axis) open.

    When transporting a box to its designated storage location, movers are allowed to push it on the warehouse floor, to slide it along the side of another box, and to move it without touching any other box or warehouse wall. Movers are instructed not to rotate the boxes and that boxes should not collide with each other or the warehouse walls. Once a box has been placed in its assigned storage area, it cannot be moved again. If a box cannot be moved to its destination, then it is rejected and it will not hinder the placement of subsequent boxes.

    输入

    The input starts with the number of test cases to be processed on a line by itself. Each test case starts with three integers B, Depth and Frontage, on a line by themselves. B is the number of boxes. 0 B 200. Depth and Frontage are the dimensions of the warehouse, as described above. Each of the following B lines contains 5 integers: ID, X, Y, W and H. A single blank space is used to separate the integers. ID is a unique number for each box. X and Y are the coordinates where the bottom left corner of the box must be placed. W and H are the width and height of the box, respectively.

    1 Depth, Frontage 1000000

    1 ID 1000, 1 X, W Depth, and 1 Y, H Frontage

    输出

    Description

    The manager in charge of a large warehouse is expecting a large number of boxes to be delivered for storage.

    The warehouse has the form of a rectangle with the bottom left corner at (0, 0) and the top right corner at (Depth, Frontage). There are walls on three sides with the left side (the one along the y-axis) open.

    When transporting a box to its designated storage location, movers are allowed to push it on the warehouse floor, to slide it along the side of another box, and to move it without touching any other box or warehouse wall. Movers are instructed not to rotate the boxes and that boxes should not collide with each other or the warehouse walls. Once a box has been placed in its assigned storage area, it cannot be moved again. If a box cannot be moved to its destination, then it is rejected and it will not hinder the placement of subsequent boxes.

    Input

    The input starts with the number of test cases to be processed on a line by itself. Each test case starts with three integers B, Depth and Frontage, on a line by themselves. B is the number of boxes. 0 B 200. Depth and Frontage are the dimensions of the warehouse, as described above. Each of the following B lines contains 5 integers: ID, X, Y, W and H. A single blank space is used to separate the integers. ID is a unique number for each box. X and Y are the coordinates where the bottom left corner of the box must be placed. W and H are the width and height of the box, respectively.

    1 Depth, Frontage 1000000

    1 ID 1000, 1 X, W Depth, and 1 Y, H Frontage

    Output

    Output of each test case consists of one or more lines. The first line starts with the string "Case" followed by the test case number (starting at 0). For each box that cannot be placed, print the string "Reject" and the box ID on a line by themselves. The string and integer are separated by a single space. Rejected boxes should be listed in the same order as they appear in the input.

    Sample Input

    1
    5 30 20
    7 3 1 8 15
    9 24 1 7 3
    11 12 14 8 5
    13 14 8 10 3
    15 15 4 5 3

    Sample Output

    Case 0
    Reject 9
    Reject 11

    Hint

    Illustration of the sample data showing the successfully placed boxes

    Source

    样例输入

    1
    5 30 20
    7 3 1 8 15
    9 24 1 7 3
    11 12 14 8 5
    13 14 8 10 3
    15 15 4 5 3

    样例输出

    Case 0
    Reject 9
    Reject 11

    提示

    Illustration of the sample data showing the successfully placed boxes


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部