448A Rewards solution

  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int a1,a2,a3;
  6. int b1,b2,b3;
  7. int n;
  8. cin>>a1>>a2>>a3;
  9. cin>>b1>>b2>>b3;
  10. cin>>n;
  11. int s=a1+a2+a3;
  12. int m=0;
  13. int b=b1+b2+b3;
  14. if(s%5>0){m=s%5; s=s+(5-m);}
  15. //cout<<s;
  16. if(n==1 and s>=1 and b>=1 ) cout<<"NO"<<endl;
  17. else {n=n*5;
  18. if((n-s)*2>=b ) cout<<"YES"<<endl;
  19. else cout<<"NO";
  20. return 0;
  21.  
  22. }

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

Aptitude test assistant programmer 2018

1041A. Heist solution