codeforces1000c csdn-博客
You are given nn segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is the following: for every k∈[1…n]k∈[1…n], calculate the number of points with integer coordinates such that the number of segments that cover these points equals kk. A segment with endpoints lili and riri covers point xx if and only if li≤x≤rili≤x≤ri. Input The first line of the input contains one integer nn (1≤n≤2⋅1051≤n≤2⋅105) — the number of segments. The