Skip to content

Instantly share code, notes, and snippets.

@phongngtuan
Created April 15, 2016 11:03
Show Gist options
  • Select an option

  • Save phongngtuan/a9eddbc279c7380f0edd00e1e63bf848 to your computer and use it in GitHub Desktop.

Select an option

Save phongngtuan/a9eddbc279c7380f0edd00e1e63bf848 to your computer and use it in GitHub Desktop.
1799_Yeehaa
#include <iostream>
#include <tgmath.h>
using namespace std;
#define PI 3.14159265
int main()
{
int N;
cin >> N;
double R, r;
int n;
cout.precision(3);
for (int i=0; i<N; i++)
{
cin >> R >> n;
cout << fixed << R/(1 + 1/sin(PI/n));
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment