#P6244. [USACO06OPEN] County Fair Events S
[USACO06OPEN] County Fair Events S
Background
This problem is a shortened version that keeps the original meaning unchanged.
Problem Description
FJ is attending events.
He wants to attend as many of the events as possible. After finishing one event, he can immediately attend the next one.
Given the list of events FJ can attend, their start time and duration , find the maximum number of events FJ can attend.
FJ will not leave any event early.
Input Format
The first line contains an integer .
Lines to : each line contains two integers and separated by a space, with the meaning described above.
Output Format
Output only one line: the maximum number of events FJ can attend.
7
1 6
8 6
14 5
19 2
1 8
18 3
10 6
4
Hint
Translated by ChatGPT 5