CF685D.Kay and Eternity

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Snow Queen told Kay to form a word "eternity" using pieces of ice. Kay is eager to deal with the task, because he will then become free, and Snow Queen will give him all the world and a pair of skates.

Behind the palace of the Snow Queen there is an infinite field consisting of cells. There are nn pieces of ice spread over the field, each piece occupying exactly one cell and no two pieces occupying the same cell. To estimate the difficulty of the task Kay looks at some squares of size k×kk×k cells, with corners located at the corners of the cells and sides parallel to coordinate axis and counts the number of pieces of the ice inside them.

This method gives an estimation of the difficulty of some part of the field. However, Kay also wants to estimate the total difficulty, so he came up with the following criteria: for each xx ( 1<=x<=n1<=x<=n ) he wants to count the number of squares of size k×kk×k , such that there are exactly xx pieces of the ice inside.

Please, help Kay estimate the difficulty of the task given by the Snow Queen.

输入格式

The first line of the input contains two integers nn and kk ( 1<=n<=1000001<=n<=100000 , 1<=k<=3001<=k<=300 ) — the number of pieces of the ice and the value kk , respectively. Each of the next nn lines contains two integers xix_{i} and yiy_{i} ( 109<=xi,yi<=109-10^{9}<=x_{i},y_{i}<=10^{9} ) — coordinates of the cell containing ii -th piece of the ice. It's guaranteed, that no two pieces of the ice occupy the same cell.

输出格式

Print nn integers: the number of squares of size k×kk×k containing exactly 1,2,...,n1,2,...,n pieces of the ice.

输入输出样例

  • 输入#1

    5 3
    4 5
    4 6
    5 5
    5 6
    7 7
    

    输出#1

    10 8 1 4 0 
    
首页