/* Yeehaa! */
/* Christoph Mueller */

#include <stdio.h>
#include <assert.h>
#include <math.h>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

int main(void)
{
  int sc, s;
  float R;
  int n;

  assert(scanf("%d", &sc) == 1);

  for(s=0; s<sc; s++)
    {
      assert(scanf("%f%d", &R, &n) == 2);
      assert(2 <= n && n <= 100);
      assert(1 <= R && R <= 100);
      
      printf("Scenario #%d:\n", s+1);
      printf("%.3f\n\n", R*sin(M_PI/n)/(1+sin(M_PI/n)));
    }

  return(0);
}
