UVA 10432 - Polygon Inside A Circle

Problem PDF

Solution:

/*-------------------------------------------------------------*/
//Poblem Setter : Suman Mahbub
//Uva Problem No: 10432
//Problem Name  : Polygon Inside A Circle
//Type          : Geometry, Area of a regular convex polygon.
//Author        : Shipu Ahamed
//University    : BUBT
//E-mail        : shipuahamed01@gmail.com
/*--------------------------------------------------------------*/

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ll long long
#define sc scanf
#define pf printf
#define pi 2*acos(0.0)
using namespace std;
int main()
{
 double r,s,p;
 while(sc("%lf %lf",&r,&s)==2)
        pf("%.3lf\n",r*r*s*sin((2*pi)/s)/2);
 return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10432/10432.cpp