#P1868. 饥饿的奶牛
饥饿的奶牛
Description
A cow broke through the fence and reached a sanctuary (for cows), where a message was written in the cow language.
Translated, it says:
There are intervals. Each interval provides , a total of piles of premium pasture. You may choose any intervals, but they must not overlap.
For the cow, the more it eats, the better. However, the cow is not very smart, so please help it.
Input Format
The first line contains an integer .
The next lines each contain two numbers , describing an interval.
Output Format
Output the maximum number of pasture piles the cow can eat.
3
1 3
7 8
3 4
5
Hint
,。
Translated by ChatGPT 5
京公网安备 11011102002149号