#abc325b. B - World Meeting
B - World Meeting
Score : points
问题描述
Keyence在全球拥有个基地,编号从到。第个基地有名员工,在协调世界时(UTC)的0点,基地的时间为点。
你希望在整个公司范围内召开一场一小时的会议。每位员工只有在其所在基地的9:00-18:00时间段内完全包含会议时间时才能参加会议。请确定会议时间,使得尽可能多的员工能够参加,并找出最多能有多少名员工参加会议。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Keyence has bases worldwide, numbered to . Base has employees, and at o'clock in Coordinated Universal Time (UTC), it is o'clock at base .
You want to hold a one-hour meeting across the entire company. Each employee can only participate in the meeting if the meeting time is completely within the 9:00-18:00 time slot at their base. Find the maximum number of employees who can participate when deciding the meeting time to allow as many employees as possible to participate.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the maximum number of employees who can participate in the meeting.
Sample Input 1
3
5 0
3 3
2 18
Sample Output 1
8
Consider holding the meeting from 14:00 to 15:00 in UTC.
- The meeting is held from 14:00 to 15:00 at base , so the employees at base can participate in the meeting.
- The meeting is held from 17:00 to 18:00 at base , so the employees at base can participate in the meeting.
- The meeting is held from 8:00 to 9:00 at base , so the employees at base cannot participate in the meeting.
Thus, a total of employees can participate in the meeting. No meeting time allows more employees to participate.
Sample Input 2
2
1 10
1000000 20
Sample Output 2
1000000
Sample Input 3
6
31 3
20 8
11 5
4 3
47 14
1 18
Sample Output 3
67
update @ 2024/3/10 01:47:32