Advertisement
amine99

Untitled

Apr 29th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long LL;
  4. typedef vector<int> VI;
  5. typedef pair<int,int> PI;
  6.  
  7. const int N=1e5+1;
  8. int n,a,b,s,fhole,ans;
  9. int t[N];
  10.  
  11. int main() {
  12.    cin >> n >> a >> b >> fhole;
  13.    s = fhole;
  14.    for(int i = 0 ; i < n-1 ; i++) {
  15.       cin >> t[i];
  16.       s += t[i];
  17.    }
  18.    sort(t,t+n,greater<int>());
  19.    for(int i = 0 ; i < n - 1 ; i++) {
  20.       if((fhole * a) / s < b)
  21.          ans++;
  22.       else
  23.          break;
  24.       s -= t[i];
  25.    }
  26.    cout << ans;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement