跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1116. Juicer

    ID: 1122 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>模拟编程与模拟入门难度共享题库Codeforces英文题面题目来源题面语言

Juicer

题目描述

A. Juicer
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Kolya is going to make fresh orange juice. He has n oranges of sizes a1,a2,...,an. Kolya will put them in the juicer in the fixed order, starting with orange of size a1, then orange of size a2 and so on. To be put in the juicer the orange must have size not exceeding b, 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 d. 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?

Input

The first line of the input contains three integers n, b and d (1≤n≤100000, 1≤bd≤1000000)− the number of oranges, the maximum size of the orange that fits in the juicer and the value d, which determines the condition when the waste section should be emptied.

The second line contains n integers a1,a2,...,an (1≤ai≤1000000)− sizes of the oranges listed in the order Kolya is going to try to put them in the juicer.

Output

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

Examples
Input
2 7 10
5 6
Output
1
Input
1 5 10
7
Output
0
Input
3 10 10
5 7 7
Output
1
Input
1 1 1
1
Output
0
Note

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.


题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 583 题。保留原作者与原赛事署名。