Created
October 6, 2017 07:59
-
-
Save mhmoodlan/2cb208e4d38e0a52f846af3189f354df to your computer and use it in GitHub Desktop.
#Implementation #Easy #Codeforces #Solved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://codeforces.com/contest/709/problem/A | |
#include <bits/stdc++.h> | |
#define ll long long | |
#define sz(v) ((int) ((v).size())) | |
#define clr(v, d) memset(v, d, sizeof(v)) | |
#define lp(i, n) for(int i = 0; i < (int)(n); ++i) | |
#define rep(i, v) for(int i = 0; i < sz(v); ++i) | |
using namespace std; | |
int main() { | |
int n, b, d, x, sum=0, output = 0; cin>>n>>b>>d; | |
lp(i, n) { | |
cin>>x; | |
if(x <= b) { | |
sum+=x; | |
if(sum > d) { | |
sum = 0; | |
output++; | |
} | |
} | |
} | |
if(sum > d) output++; | |
cout << output << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment