5445. Line Segments Trace I
时间限制:1000 MS 内存限制:256 MB
题目描述
## 题目描述 There are nnn line segments whose endpoints have integer coordinates. The left x-coordinate of each segment is 000 and the right x-coordinate is mmm. The slope of each segment is an integer. For each x-coordinate 0,1,\dots,m0,1,\dots,m0,1,\dots,m, find the maximum point in any line segment. ## 输入格式 The first line has two integers nnn and mmm: the number of line segments and the maximum x-coordinate. The next nnn lines describe the line segments. Each line has two integers y1y_1y1 and y2y_2y2: there is a line segment between points (0,y1)(0,y_1)(0,y1) and (m,y2)(m,y_2)(m,y2). ## 输出格式 Print m+1m+1m+1 integers: the maximum points for x=0,1,\dots,mx=0,1,\dots,mx=0,1,\dots,m. ## 数据范围 - 1\len,m\le1051 \le n, m \le 10^51\len,m\le105 - 0\ley1,y2\le1090 \le y_1,y_2 \le 10^90\ley1,y2\le109 ## 样例 ## 输入 ```in1 4 5 1 6 7 2 5 5 10 0 ``` ## 输出 ```out1 10 8 6 5 5 6 ```