#679
Unrated
Grass Segments
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Bessie is planting some grass on the positive real line. She has NN (2N21052\le N\le 2\cdot 10^5) different cultivars of grass, and will plant the iith cultivar on the interval [i,ri][\ell_i, r_i] (0<i<ri1090 < \ell_i < r_i \leq 10^9).

In addition, cultivar ii grows better when there is some cultivar jj (jij\neq i) such that cultivar jj and cultivar ii overlap with length at least kik_i (0<kirii0 < k_i \leq r_i - \ell_i). Bessie wants to evaluate all of her cultivars. For each ii, compute the number of jij\neq i such that jj and ii overlap with length at least kik_i.

입력

The first line contains NN.

The next NN lines each contain three space-separated integers i\ell_i, rir_i, and kik_i.

출력

The answers for all cultivars on separate lines.

예제 입력 1

2
3 6 3
4 7 2

예제 출력 1

0
1

예제 입력 2

4
3 6 1
2 5 1
4 10 1
1 4 1

예제 출력 2

3
3
2
2

예제 입력 3

5
8 10 2
4 9 2
3 7 4
5 7 1
2 7 1

예제 출력 3

0
3
1
3
3

점수

Input 4-5: N5000N \leq 5000Inputs 6-11: kk is the same for all intervalsInputs 12-20: No additional constraints.

In addition, for Inputs 5, 7, ..., 19, ri2Nr_i \leq 2N for all ii.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.