#P8021. [ONTAK2015] Bajtman i Okrągły Robin
[ONTAK2015] Bajtman i Okrągły Robin
Problem Description
There are robbers. The -th robber will choose one time slot of length to rob from the following intervals: $[a_i, a_i + 1], [a_i + 1, a_i + 2], \cdots, [b_i - 1, b_i]$, and plans to steal dollars. As a security guard, in each time slot of length you can stop at most one robber. What is the maximum loss you can recover?
Input Format
The first line contains an integer .
The next lines each contain three integers .
Output Format
One line containing an integer, representing the required value.
4
1 4 40
2 4 10
2 3 30
1 3 20
90
Hint
For of the testdata, , , .
Translated by ChatGPT 5