Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int i,j,k,l,price[10],ans,p;
- double rto,area,x,y,z,x1,x2,yl,y2,z1,z2,hh[10],ww[10],h,w;
- int main()
- {
- price[0]=319;
- price[1]=419;
- price[2]=450;
- price[3]=519;
- price[4]=599;
- price[5]=600;
- price[6]=630;
- price[7]=719;
- hh[0]=1024;
- hh[1]=1024;
- hh[2]=960;
- hh[3]=2048;
- hh[4]=1136;
- hh[5]=1280;
- hh[6]=1920;
- hh[7]=1136;
- ww[0]=768;
- ww[1]=600;
- ww[2]=640;
- ww[3]=1536;
- ww[4]=640;
- ww[5]=800;
- ww[6]=1080;
- ww[7]=640;
- while(scanf("%lf %lf",&h,&w)!=EOF)
- {
- if((h==0)&&(w==0))
- {
- break;
- }
- rto=0;
- for(i=0;i<7;i++)
- {
- area=hh[i]*ww[i];
- x1=hh[i];
- z1=hh[i]/h;
- yl=floor(w*z1);
- z1=(x1*yl)/area;
- x2=ww[i];
- z2=ww[i]/h;
- y2=floor(w*z2);
- z2=(x2*y2)/area;
- z=max(z1,z2);
- if(rto<=z)
- {
- rto=z;
- p=price[i];
- cout<<rto<<" "<<i<<" "<<p<<endl;
- }
- }
- printf("%d\n",p);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement