#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <cmath>

using namespace std;
typedef long double ld;
typedef complex<ld> pt;
const ld EPS = 1e-9;

int main() {
	int ncase; cin >> ncase;
	while (ncase--) {
		int r, n; cin >> r >> n;
		pt pol[n];
		for (int i = 0; i < n; i++) {
			int x, y; cin >> x >> y;
			pol[i] = pt(x, y);
		}

		ld origlen = 0;
		for (int i = 0; i < n; i++) {
			origlen += abs(pol[i] - pol[(i+1)%n]);
		}
		ld minlen = 2*acos(-1)*r;
		if (origlen < minlen - EPS) {
			cout << "Not possible" << endl;
		} else if (origlen < minlen + EPS) {
			cout << 0 << endl;
		} else {
			cout << setprecision(16) << fixed << (origlen - minlen)/origlen << endl;
		}
	}
}