Codeforces Round 359 (Div. 1)
D
Kay and Eternity
Codeforces
2600
原题
← CE →
翻译中…

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 $*n*$ 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* × *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 $*x*$ ($1 ≤ *x* ≤ *n*$) he wants to count the number of squares of size $*k* × *k*$, such that there are exactly $*x*$ pieces of the ice inside.

翻译中…

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

翻译中…

Input

翻译中…

The first line of the input contains two integers $*n*$ and $*k*$ ($1 ≤ *n* ≤ 100 000$, $1 ≤ *k* ≤ 300$) — the number of pieces of the ice and the value $*k*$, respectively. Each of the next $*n*$ lines contains two integers $*x*_{*i*}$ and $*y*_{*i*}$ ($- 10^{9} ≤ *x*_{*i*}, *y*_{*i*} ≤ 10^{9}$) — coordinates of the cell containing $*i*$-th piece of the ice. It's guaranteed, that no two pieces of the ice occupy the same cell.

翻译中…

Output

翻译中…

Print $*n*$ integers: the number of squares of size $*k* × *k*$ containing exactly $1, 2, ..., *n*$ pieces of the ice.

翻译中…

样例

Input #1
5 3
4 5
4 6
5 5
5 6
7 7
Output #1
10 8 1 4 0
InputCopy OutputCopy
题目信息
题号
685D
时间限制
2 s
内存限制
256 MB
标签
暴力
模拟
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。