Advertisement
yicongli

Gym 313459A

Jan 24th, 2021
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define gc c=getchar()
  6. #define r(x) read(x)
  7. #define ll long long
  8.  
  9. template<typename T>
  10. inline void read(T&x){
  11.     x=0;T k=1;char gc;
  12.     while(!isdigit(c)){if(c=='-')k=-1;gc;}
  13.     while(isdigit(c)){x=x*10+c-'0';gc;}x*=k;
  14. }
  15.  
  16. const int N=6;
  17.  
  18. int cnt[N];
  19. int denomination[]={1, 5, 10, 20, 50, 100};
  20.  
  21. int main(){
  22.     // freopen(".in","r",stdin);
  23.     // freopen(".out","w",stdout);
  24.     int mx=0;
  25.     for(int i=0;i<N;++i){
  26.         r(cnt[i]);
  27.         if(denomination[i]*cnt[i]>=denomination[mx]*cnt[mx])mx=i;
  28.     }
  29.     printf("%d\n",denomination[mx]);
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement