|
|
back to boardWa#43 The code is here. Posted by Hrayr 18 Jun 2011 16:09 #include <iostream> #include <cmath> using namespace std; int max (int a,int b) { return a>b? a:b;} int min (int a,int b) { return a>b? b:a;} double const pi=acos(-1.0); int main() { int a,b,d; int r1,r2,R1,R2,h; cin>>a>>b>>d>>r1>>R1>>r2>>R2>>h; if (2*max(R1,R2)<=min(a,b) && pi*R1*R1+pi*R2*R2<=a*b) { cout<<"YES"; return 0; } cout<<"NO"; return 0; } Edited by author 03.07.2011 21:46 Re: Wa#43 The code is here. Don't forget about case when h > d (so trays are touching plate a little bit lower) and try to place trays in opposite corners of plate. |
|
|