#Q89. 「一本通 3.4 例 1」Intervals
「一本通 3.4 例 1」Intervals
Description
Original source: Southwestern Europe 2002, problem statement can be found at POJ 1201.
Given closed intervals and integers , you need to construct an integer set such that for any , the number of integers in that satisfy is at least . Find the minimum number of integers that such a set must contain.
In simpler terms, select as few integers as possible from the range such that each interval contains at least selected integers.
Input Format
The first line contains an integer , representing the number of intervals.
The following lines describe the intervals. The -th line contains three integers , separated by spaces.
Output Format
A single line outputting the minimum number of integers required to meet the conditions.
Sample 1
5
3 7 3
8 10 3
6 8 1
1 3 1
10 11 1
6
Data Range and Hints
For all data, , , and .