Click Here to see the problem detail.
Solution
let,
Length of the flag = L,
Width of the flag = W,
Radius of the red circle = r;
so, according to question,
L:W=10:6
=>L/W=10/6
=>W/L=6/10
=>W=(6/10)*L
again,
L:r=5:1
=>L/r=5/1
=>r/L=1/5
=>r=(1/5)*L
Now, Area of entire flag= L*W
Area of red circle =∏*r2
Area of green part=L*W-∏*r2
Source Code
#include<stdio.h>
#include<math.h>
int main()
{
double pi=acos(-1), l, w, r;
int tc;
scanf("%d",&tc);
while(tc--)
{
scanf("%lf",&l);
w=(l/10)*6;
r=l/5;
printf("%.2lf %.2lf\n",pi*r*r,(l*w)-(pi*r*r));
}
return 0;
}
Next Previous