All pastes #346515 Raw Edit

ravehanker

public text v1 · immutable
·published 2007-02-09 13:08 UTC
rendered paste body
#include <stdio.h>
#include <math.h>

#define PI 3.14159265358979323846

int main()
{
	int r;
	int first=1;
	while(1) {
		scanf("%d", &r);
		if (r==0) break;
		if(first) first = 0;
		else printf("\n");
		int t;
		scanf("%d", &t);
		int i;
		for (i=0; i<t; ++i) {
			int n;
			scanf("%d", &n);
			printf("%d\n", (int)round(2*r*n*sin(PI/n)));
		}
	}
	return 0;
}