GastonFontenla

Timus: 1688 - Team.GOV

Jun 5th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     long long a, b, n;
  8.     cin >> a >> n;
  9.     a*=3;
  10.  
  11.     long long s = 0;
  12.  
  13.     for(int i=0; i<n; i++)
  14.     {
  15.         cin >> b;
  16.         s += b;
  17.         if(s > a)
  18.         {
  19.             cout << "Free after " << i+1 << " times." << endl;
  20.             return 0;
  21.         }
  22.     }
  23.  
  24.     cout << "Team.GOV!" << endl;
  25.  
  26.     return 0;
  27. }
Add Comment
Please, Sign In to add comment