CF709A.Juicer

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

Kolya is going to make fresh orange juice. He has nn oranges of sizes a1,a2,...,ana_{1},a_{2},...,a_{n} . Kolya will put them in the juicer in the fixed order, starting with orange of size a1a_{1} , then orange of size a2a_{2} and so on. To be put in the juicer the orange must have size not exceeding bb , so if Kolya sees an orange that is strictly greater he throws it away and continues with the next one.

The juicer has a special section to collect waste. It overflows if Kolya squeezes oranges of the total size strictly greater than dd . When it happens Kolya empties the waste section (even if there are no more oranges) and continues to squeeze the juice. How many times will he have to empty the waste section?

输入格式

The first line of the input contains three integers nn , bb and dd ( 1<=n<=1000001<=n<=100000 , 1<=b<=d<=10000001<=b<=d<=1000000 ) — the number of oranges, the maximum size of the orange that fits in the juicer and the value dd , which determines the condition when the waste section should be emptied.

The second line contains nn integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 1<=ai<=10000001<=a_{i}<=1000000 ) — sizes of the oranges listed in the order Kolya is going to try to put them in the juicer.

输出格式

Print one integer — the number of times Kolya will have to empty the waste section.

输入输出样例

  • 输入#1

    2 7 10
    5 6
    

    输出#1

    1
    
  • 输入#2

    1 5 10
    7
    

    输出#2

    0
    
  • 输入#3

    3 10 10
    5 7 7
    

    输出#3

    1
    
  • 输入#4

    1 1 1
    1
    

    输出#4

    0
    

说明/提示

In the first sample, Kolya will squeeze the juice from two oranges and empty the waste section afterwards.

In the second sample, the orange won't fit in the juicer so Kolya will have no juice at all.

首页