#P15437. [蓝桥杯 2025 国 Python B] 机器人充电站规划
[蓝桥杯 2025 国 Python B] 机器人充电站规划
Problem Description
A logistics company uses different models of robots to work in a warehouse. A robot can start charging at any time; it does not need to wait until the battery is completely drained. Likewise, charging can end at any time; it does not need to wait until the battery is full. The only requirement is to ensure that, within any continuous minutes, each robot can obtain a total of minutes of charging time.
The company plans to set up charging stations in the warehouse. A charging station can charge any model of robot, and each charging station can charge only one robot at any moment. Except for charging time, robots are running at all other times. To ensure operating efficiency, the company wants to arrange a charging schedule and assign each robot to exactly one charging station (the assignment does not change after being made), so that every robot can be charged on time, and the utilization of all charging stations is as balanced as possible.
The load rate of a charging station is defined as the ratio of the time this station is used to charge robots to the total time. The load rate can be calculated as the sum of over all robots assigned to it. The load rate must not exceed .
Compute, under the optimal arrangement, the minimum possible value of the maximum load rate among the charging stations (that is, the usage percentage of the most heavily used charging station).
Input Format
The first line contains two positive integers , separated by a space, representing the number of robot models and the number of charging stations.
The next lines each contain two positive integers , separated by a space, representing the working cycle and the charging time of the -th robot model.
The next lines each contain an integer , representing the number of robots of the -th model.
Output Format
Output one line containing an integer, which is the answer: the minimum possible maximum load rate, expressed as a percentage. Convert it to a percentage first, then round to the nearest integer.
1 6
9 1
5
11
4 2
9 3
8 1
7 1
7 4
2
2
1
1
82
Hint
Sample Explanation 1
There are robots of the same specification and charging stations, so we can assign one charging station to each robot. In this case, the maximum utilization of the charging stations is , which becomes as a percentage.
Sample Explanation 2
| Model 1 | Model 2 | Model 3 | Model 4 | |
|---|---|---|---|---|
| Station 1 | 2 | / | 1 | / |
| Station 2 | / | 2 | / | 1 |
According to the assignment plan in the table above, the load rate of station 1 is , which becomes after converting to a percentage and rounding;
The load rate of station 2 is , which becomes after converting to a percentage and rounding. Therefore, the answer is .
Constraints and Notes on Testdata
For of the testdata, , .
For of the testdata, , .
For all testdata, , , .
Translated by ChatGPT 5