ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1793. Tray 2

Wa#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.
Posted by MOPDOBOPOT (USU) 28 Aug 2012 01:01
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.