1114A - Got Any Grapes?


  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int x,y,z;
  6. cin>>x>>y>>z;
  7. int a,b,c;
  8. cin>>a>>b>>c;
  9.  
  10. int green = a-x;
  11. int gandp= green+b;
  12. int smith = gandp- y;
  13. int drick = smith+c-z;
  14. if(green<0 or smith<0 or drick <0)
  15. cout<<"NO";
  16. else cout<<"YES";
  17.  
  18. }
 

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

Aptitude test assistant programmer 2018

1041A. Heist solution