Guest User

Untitled

a guest
Sep 14th, 2012
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <cmath>
  2. #include <iostream>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. const double PI = 3.14159265;
  8.  
  9. struct cone{ long long r1,r2; };
  10.  
  11. inline long long  countx(const long long &R1,const long long &R2,const long long &H,const long long &D){
  12.  if(H<=D) return R2;
  13.  return (R1*(H-D) + R2*D);
  14.  }
  15.  
  16. int main(){
  17. long long a,b,d,h;
  18. cin >> a >> b >> d;
  19. cone c1, c2;
  20. cin >> c1.r1 >> c1.r2; cin >> c2.r1 >> c2.r2;
  21. cin >> h;
  22. long long x1 = countx(c1.r1,c1.r2,h,d);
  23. long long x2 = countx(c2.r1,c2.r2,h,d);
  24. if(2*max(x1,x2) <= h*min(a,b) && (x1+x2+h*c1.r2 + h*c2.r2)*(x1+x2+h*c1.r2+h*c2.r2) <= h*h*(a*a+b*b)){
  25. cout <<"YES"    << endl;
  26. return 0;
  27. }
  28. cout << "NO" << endl;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment