Grass Segments
시간 제한2초메모리 제한1024 MB
각 구간 i에 대해, 길이가 k_i 이상 겹치는 다른 구간의 개수를 센다.
문제
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.