CF1041C Coffee Break

题目描述

### 题目大意: 给定$n$个数和一个$k$,这$n$个数都不超过$m$ 每次从没被去掉的数里面选一个数$a$,去掉$a$,然后可以任意一个$b(b>a+k)$,然后去掉任意一个$c(c>b+k)$,以此类推 问最少能选多少个$a$,然后输出每个数都是选第几个$a$的时候被去掉的

输入格式

一行三个整数$n,m,k$ 再一行$n$个整数,表示给定的数

输出格式

第一行一个整数,表示最少选$a$的个数 第二行$n$个整数,表示每个数都是选第几个$a$时被去掉的

说明/提示

In the first example, Monocarp can take two coffee breaks during the first day (during minutes $ 1 $ and $ 5 $ , $ 3 $ minutes will pass between these breaks). One break during the second day (at minute $ 2 $ ), and one break during the third day (at minute $ 3 $ ). In the second example, Monocarp can determine the day of the break as follows: if the minute when he wants to take a break is odd, then this break is on the first day, if it is even, then this break is on the second day.