fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main() {
  7. double a=0, b=0, c, n;
  8. for(int i=0; i<3; i++) scanf("%lf", &c), a+=c;
  9. for(int i=0; i<3; i++) scanf("%lf", &c), b+=c;
  10. scanf("%lf", &n);
  11. a=ceil(a/5), b=ceil(b/10);
  12. if(n>=a+b) printf("YES");
  13. else printf("NO");
  14. return 0;
  15. }
Success #stdin #stdout 0s 3344KB
stdin
1 1 3
2 3 4
2
stdout
YES