Advertisement
rengetsu

Codeforces_448A

Oct 17th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. //Codeforces 448A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, a, asum=0, b, bsum=0, s=0;
  7.     for(int i=0;i<3;i++)
  8.     {
  9.         cin >> a;
  10.         asum+=a;
  11.     }
  12.     for(int i=0;i<3;i++)
  13.     {
  14.         cin >> b;
  15.         bsum+=b;
  16.     }
  17.     cin >> n;
  18.     while(asum>0)
  19.     {
  20.         asum-=5;
  21.         s++;
  22.     }
  23.     while(bsum>0)
  24.     {
  25.         bsum-=10;
  26.         s++;
  27.     }
  28.     if(s<=n){cout << "YES";}
  29.     else{cout << "NO";}
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement