#include <bits/stdtr1c++.h>
using namespace std;

typedef long double ld;
typedef complex<ld> pt;
typedef vector<pt> pol;

const ld EPS = 1e-7;
const ld pi = 3.1415926535897932384626433832795L;

ld cp(const pt& a, const pt& b) { return imag(conj(a)*b); }
ld dp(const pt& a, const pt& b) { return real(conj(a)*b); }

ld r;
int n;

inline ld perimeter(const pol& p, ld s) {
  ld x = 0;
  for (int i = 0; i < n; i++)
    x += abs(p[i]*s-p[(i+1)%n]*s);
  return x;
}

inline ld arcs(const pol& p, ld s) {
  ld x = 0;
  for (int i = 0; i < p.size(); i++) {
    pt a = p[i]*s, b = p[(i+1)%n]*s, c = p[(i+2)%n]*s;
    pt A = a-b, B = c-b;
    if (abs(A.real()+B.real()) < 1e-9 && abs(A.imag()+B.imag()) < 1e-9)
      continue;
    ld t = acos(dp(A,B)/(abs(A)*abs(B)));
    x += r*(pi-t);
  }
  return x;
}

int main() {
  ios::sync_with_stdio(0);
  int t; cin >> t;
  while (t--) {
    pol p;
    cin >> r >> n;
    for (int i = 0; i < n; i++) {
      ld x, y; cin >> x >> y;
      p.push_back(pt(x,y));
    }
    ld X = perimeter(p,1.0L);
    if (perimeter(p,1e-9)+arcs(p,1e-9) > X) {
      cout << "Not possible\n";
      continue;
    }
    ld lo = EPS, hi = 1;
    while (hi-lo > EPS) {
      ld mid = (lo+hi)/2;
      if (perimeter(p,mid)+arcs(p,mid) < X)
        lo = mid;
      else
        hi = mid;
    }
    cout << fixed << setprecision(7) << lo << "\n";
  }
  return 0;
}