Solve of UVA 12611: Beautiful Flag
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,i,leng,widt,x1,x2,y1,y2;
cin>>a;
for(i=1;i<=a;i++)
{
cin>>b;
leng=b*5;
x1=(b*9)/4;
x2=leng-x1;
y1=(3*leng)/10;
printf("Case %d:\n",i);
cout<<-x1<<" "<<y1<<endl;
cout<<x2<<" "<<y1<<endl;
cout<<x2<<" "<<-y1<<endl;
cout<<-x1<<" "<<-y1<<endl;
}
return 0;
}
No comments:
Post a Comment