Advertisement
Guest User

Untitled

a guest
May 1st, 2018
2,790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define sc(a) scanf("%lld",&a)
  6.  
  7. typedef long long ll;
  8.  
  9. const int MAX = 5e3 + 11;
  10.  
  11. ll a[22];
  12. ll pro[22];
  13.  
  14. int main()
  15. {
  16.     for(int i=0;i<14;++i)
  17.         sc(a[i]);
  18.  
  19.     ll res = 0;
  20.  
  21.     for(int i=0;i<14;++i)
  22.     {
  23.         for(int j=0;j<14;++j)
  24.             pro[j] = a[j];
  25.         ll tmp = pro[i];
  26.         pro[i] = 0;
  27.         for(int j=0;j<14;++j)
  28.             pro[j] += tmp/14;
  29.         tmp %= 14;
  30.         int k = i+1;
  31.         while(tmp--)
  32.         {
  33.             if(k == 14)
  34.                 k = 0;
  35.             pro[k++]++;
  36.         }
  37.         ll score = 0;
  38.         for(int j=0;j<14;++j)
  39.         {
  40.             if(pro[j] & 1)
  41.                 continue;
  42.             score += pro[j];
  43.         }
  44.         res = max(res,score);
  45.     }
  46.  
  47.     cout<<res;
  48.  
  49.  
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement