## UVA Problem 10221 ( Satellites) Solution

#include<bits/stdc++.h> #define PI acos(-1) using namespace std; int main () { double dis_of_sate ,angle,r; char s[4]; while(cin>>dis_of_sate>>angle>>s) // circle (arc) length s=r*theta. (chord) length = 2*rsin(C/2) { if(s[0]==’m’) angle/=60; if(angle>180) angle=360-angle; // tribhujer kono kon 180 er boro hoy na…

## UVA Problem 10286 (Trouble with a Pentagon) Solution

#include <bits/stdc++.h> #include <math.h> #define pi acos(0.0) //#define pi 3.1416 int main() { double n; while(scanf(“%lf”,&n) != EOF ) { //poligon_inte_angle = (3/5)*180=(108 degree)as figure sides n=5; //square_inte_angle = (2/4)*90=(63 degree) as figure sides n=4; printf(“%.10lf\n”,( n*sin(108*pi/90 ) /…

## UVa Problem 10347 ( Medians) Solution

#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { double a,b,c,ans,s; while(scanf(“%lf %lf %lf”,&a,&b,&c) == 3 ) { s=(a+b+c)/2; ans=sqrt(s*(s-a)*(s-b)*(s-c)); if(ans>0) printf(“%.3lf\n”,ans*(4.0/3.0)); else { ans=-1; printf(“%.3lf\n”,ans); } } return 0; }

## UVA Problem 10451 (Ancient Village Sports) Solution

#include <bits/stdc++.h> #include<iostream> #include<math.h> #define pi 2*acos(0.0) using namespace std; int main() { double n,x,y,a,R,r,A,A1,A2,spect,offic; int c=0; while(scanf(“%lf %lf”,&n,&A)==2 && n>=3) { r=sqrt((2*A)/(n*sin(2*pi/n))); //2. Given the radius (circumradius); area(A)=((r^2)nsin(360/n)/2) R=sqrt( A/(n*tan(pi/n))); //Given the apothem (inradius) area=a^2 ntan(180/n); //printf(“Case…

## UVA Problem 10522 Solution

#include <bits/stdc++.h> #include <cmath> using namespace std; int main() { int tc; cin>>tc; while (tc) { double ha, hb, hc,a,b,c;//s,s1,a1,b1,c1,a,b,c; scanf(“%lf%lf%lf”, &ha, &hb, &hc); a=1/ha,b=1/hb,c=1/hc; double s1=(a + b + c); double a1=(-a + b + c); double…