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

int main() {
        int t;
        int r, n;
        cin >> t;
        while (t--) {
                cin >> r >> n;
                double length = 0;
                int x, y;
                vector<pair<int, int>> coords;
                coords.clear();
                for (int i = 0; i < n; i++) {
                        cin >> x >> y;
                        coords.push_back(make_pair(x, y));
                }
                for (int i = 0; i < n - 1; i++) {
                        length += sqrt((coords[i].first - coords[i+1].first) *
                                        (coords[i].first - coords[i+1].first) +
                                        (coords[i].second - coords[i+1].second) *
                                        (coords[i].second - coords[i+1].second));
                }
                length += sqrt((coords[0].first - coords[n-1].first) * 
                                (coords[0].first - coords[n-1].first) + 
                                (coords[0].second - coords[n-1].second) * 
                                (coords[0].second - coords[n-1].second));

                double result = 1.0 - (2.0 * M_PI * r ) / length;
                if (result < 0) {
                        cout << "Not possible" << endl;
                } else {
                        cout << fixed << setprecision(10) << result << endl;
                }
        }
        return 0;
}