There are platforms numbered from to in a two-dimensional coordinate plane. Each platform is represented by a point. Platform () is at .
For two integers (), you can move from platform to platform only if both of the following conditions hold.
Here is a given positive integer constant.
For each platform, write a program to count the distinct platforms that can be reached from it by making zero or more moves. The starting platform itself must be included in this count.
The first line contains two integers and , in that order, separated by a space.
The next line contains space-separated integers in that order.
Print space-separated integers on the first line. The -th integer is the number of distinct platforms reachable from platform by making zero or more moves ().
From each platform, the following platforms can be reached.
| 4 | 23 | for every integer (). |
| 5 | 33 |
| 6 | 41 | No additional constraints. |