Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. /* Dejwo to ziomal ®© */
  2.  
  3. #include <bits/stdc++.h>
  4. using namespace std;
  5. typedef long long ll;
  6.  
  7. double tab[200];
  8. int n;
  9. int sum()
  10. {
  11.     double w = 0;
  12.     for(int i=0; i<200; i++)w+=tab[i];
  13.     return round(w/n);
  14. }
  15. int main()
  16. {
  17.     ios_base::sync_with_stdio(0);
  18.  
  19.     cin>>n;
  20.     for(int i=0; i<n; i++)cin>>tab[i];
  21.    
  22.     sort(tab, tab+n);
  23.     int index = 0;
  24.  
  25.     while (sum() < 5)
  26.     {
  27.     //    cout<<sum()<<endl;
  28.         tab[index] = 5;
  29.         index++;
  30.     }
  31.     cout<<index<<endl;
  32.    
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement