Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #define int long long
- using namespace std;
- main()
- {
- int n ,a ,b ,k;
- cin >> n >> a >> b >> k ;
- int m;
- int ans=0 ;
- for(int i=0 ; i<n ; i++){
- cin >> m;
- int r = m % (a+b);
- if( r <= a && r < 0 ){
- ans++;
- }
- else
- if( r == 0 ){
- r = a+b;
- }
- int v = r / a;
- if( r % a == 0)
- v--;
- if( v <= k ){
- ans ++ ;
- k -= v;
- }
- }
- cout << ans << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement