CF1185C1 Exam in BerSU (easy version)
题目描述
$\text{CF1185C2}$是本题的数据加强版,所以,做出本题不意味着你一定能过$\text{CF1185C2}$。
白朗州大学的又一个学年到来了,很多学生都在做测试。
我们的主人公,小$\text{P}$,要去测试$n(1\leqslant n\leqslant 100)$位学生。学生们将按照$1$到$n$的顺序依次测试。考试规则如下。
- 第$i$个考生随机抽取一张标签,上面有题目。
- 如果这个考生认为这个题目太难,TA没有做这个题目就滚回家去了,那么TA这次考试不及格。
- 如果这个考生发现题目很容易,并且刚好用了$t_i$分钟完成了这道题目。那么过后,TA将带着得到的考试分数回家。
学生们按照固定的次序,依次没有中断地测试。在任何时候,小$\text{P}$从一个学生当中得到答案。
所有学生的考试时间的总和是$M(1\leqslant M\leqslant 100)$,其中保证$\max t[i]\leqslant M$,所以,成绩不好的学生更有可能花光时间以通过考试。
对于每个学生$i$,你的任务是当TA通过考试时,计算出前面最少的不及格的学生的人数。
例如以下的样例一,前5个学生做完题目所需要的时间刚好等于M,所以,他们都不需要不及格的人,所以最少的不及格人数是0。而为了让第6和第7个学生通过测试,前面分别必须让第3,4和第2,5,6个学生不及格。
输入格式
输入包含2行。第一行,给出两个数$n$和$M$(含义和范围已在题面给出),第二行给出$n$个数,其中第$i$个数表示第$i$个学生做完题目所需要的时间$t_i$。
输入保证每个$t_i$都小于$M$。
输出格式
输出仅一行,$n$个数,第$i$个数表示为了如果第$i$个人完成任务,前面最小的不及格的人数。
说明/提示
The explanation for the example 1.
Please note that the sum of the first five exam times does not exceed $ M=15 $ (the sum is $ 1+2+3+4+5=15 $ ). Thus, the first five students can pass the exam even if all the students before them also pass the exam. In other words, the first five numbers in the answer are $ 0 $ .
In order for the $ 6 $ -th student to pass the exam, it is necessary that at least $ 2 $ students must fail it before (for example, the $ 3 $ -rd and $ 4 $ -th, then the $ 6 $ -th will finish its exam in $ 1+2+5+6=14 $ minutes, which does not exceed $ M $ ).
In order for the $ 7 $ -th student to pass the exam, it is necessary that at least $ 3 $ students must fail it before (for example, the $ 2 $ -nd, $ 5 $ -th and $ 6 $ -th, then the $ 7 $ -th will finish its exam in $ 1+3+4+7=15 $ minutes, which does not exceed $ M $ ).