375

Solution: radius of an inscribed circle of a  triangle r = (2 * area of triangle) /perimeter of triangle; #include <iostream> #include <math.h> #include <stdio.h> using namespace std; int main() { int t; double B,H,R,d,a,b,r,h,c,l; double x; cin>>t; while(t–) { cin>>B>>H; l=H; h=H; a=(B/2)*(B/2); c=H*H; d=0; r=(B*H)/(B+2*sqrt(a+c)); R=r; while(r>=0.000001) { h-=2*r; d+=2*r; r=h/H*R; } printf("%13lf\n",d*M_PI);

10088

[highlight]Theory[/highlight] Picks formulae ::: ans=area of polygon-B/2+1; Given a polygon whose vertices are of integer coordinates (lattice points), count the number of lattice points within that polygon.Pick’s theoreom states that where;  is the area of the polygon.  is the number of lattice points on the exterior Area of a polygon: First, number the vertices in

10002

[highlight]Solution:[/highlight] Centroid of polygon The centroid of a non-self-intersecting closed polygon defined by n vertices (x0,y0), (x1,y1), …, (xn−1,yn−1) is the point (Cx, Cy), where Cx= 1/6A *sumof((X_i+X_i+1)*(X_i*Y_i+1 – X_i+1 * Y_i)); fori=0 to n-1 Cy= 1/6A *sumof((Y_i+Y_i+1)*(X_i*Y_i+1 – X_i+1 * Y_i));for i=0 to n-1 and where A is the polygon’s signed area, A =