#PU1426. USACO 2024 US Open Contest, Gold — Problem 2. Grass Segments
USACO 2024 US Open Contest, Gold — Problem 2. Grass Segments
USACO 2024 US Open Contest, Gold — Problem 2. Grass Segments
题目描述
Bessie is planting some grass on the positive real line. She has () different cultivars of grass, and will plant the th cultivar on the interval (). In addition, cultivar grows better when there is some cultivar () such that cultivar and cultivar overlap with length at least (). Bessie wants to evaluate all of her cultivars. For each , compute the number of such that and overlap with length at least .
输入格式
The first line contains . The next lines each contain three space-separated integers , , and .
输出格式
The answers for all cultivars on separate lines.
数据范围
(见题面原文)
样例
样例 1
2
3 6 3
4 7 2
0
1
The overlaps of the cultivars is $[4,6]$, which has length $2$, which is at
least $2$ but not at least $3$.
样例 2
4
3 6 1
2 5 1
4 10 1
1 4 1
3
3
2
2
样例 3
5
8 10 2
4 9 2
3 7 4
5 7 1
2 7 1
0
3
1
3
3