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