#include<bits/stdc++.h>

using namespace std;

typedef long double ld;

int t, n;
ld r, x, y, xp, yp, p,xf, yf;

const ld pi =3.14159265358979324, eps = 1e-5;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);
	cin>> t;
	for(int ii=0;ii<t;ii++){
		cin>>r>>n;
		p = 0;
		for(int i=0;i<=n;i++){
			swap(x,xp);swap(y,yp);
			if (i!=n)
			cin>>x>>y;
			else {
				x = xf; y = yf;
			}
			if (i==0){ 
				xf = x, yf = y;
				continue;
			}
			p+= sqrt((x-xp)*(x-xp)+(y-yp)*(y-yp));
		}
		ld s = 1.0-(2.0*pi*r)/p;
		if (s<eps) cout << "Not possible\n";
		else cout <<setprecision(10) << fixed << s << '\n';
	}
	// (1-s)p = 2*pi*r;
}