Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <iostream>
- #include <algorithm>
- using namespace std;
- const double PI = 3.14159265;
- struct cone{ long long r1,r2; };
- inline long long countx(const long long &R1,const long long &R2,const long long &H,const long long &D){
- if(H<=D) return R2;
- return (R1*(H-D) + R2*D);
- }
- int main(){
- long long a,b,d,h;
- cin >> a >> b >> d;
- cone c1, c2;
- cin >> c1.r1 >> c1.r2; cin >> c2.r1 >> c2.r2;
- cin >> h;
- long long x1 = countx(c1.r1,c1.r2,h,d);
- long long x2 = countx(c2.r1,c2.r2,h,d);
- 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)){
- cout <<"YES" << endl;
- return 0;
- }
- cout << "NO" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment