artemgf

Team.GOV!

Apr 15th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #define _USE_MATH_DEFINES
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <string>
  5. #include <set>
  6. #include <map>
  7. #include <algorithm>
  8. #include <string>
  9. #include <math.h>
  10. #include <vector>
  11. #include <cmath>
  12.  
  13. using namespace std;
  14.  
  15. int main()
  16. {
  17.     unsigned long long n, m, sc=0, sum=0, i;
  18.     bool what = false;
  19.    
  20.     cin >> n >> m;
  21.  
  22.     for(i=1;i<=m;i++)
  23.     {
  24.         cin >> sc;
  25.         sum += sc;
  26.         if (sum > n*3)
  27.         {
  28.             what = true;
  29.             cout << "Free after " << i << " times.";
  30.             break;
  31.         }
  32.     }
  33.  
  34.     if (what == false)
  35.         cout << "Team.GOV!";
  36.  
  37.     system("pause");
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment