#include "bits/stdc++.h"
using namespace std;
#define all(x) begin(x),end(x)
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { string sep; for (const T &x : v) os << sep << x, sep = " "; return os; }
#define debug(a) cerr << "(" << #a << ": " << a << ")\n";
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
const int mxN = 500+1;
const double oo = 1e20;
typedef complex<int> pt;
#define X real()
#define Y imag()
auto cross(pt u, pt v) {return (ll)u.X*v.Y-(ll)u.Y*v.X;}
auto sgn(ll a) {return a==0?0:(a>0?1:-1);}
auto ccw(pt p1, pt p2, pt p3) {auto u = p2-p1, v = p3-p2;return cross(u,v);}
auto in(pt p1, pt p2) {return (ll)p1.X*p2.X+(ll)p1.Y*p2.Y;}
auto norm(pt p) {return (ll)p.X*p.X+(ll)p.Y*p.Y;}
bool comp(const pt& a, const pt& b) { return a.X<b.X or (a.X==b.X and a.Y < b.Y);}
void read(pt& p) {
int a,b; cin >> a >> b;
p = {a,b};
}
double dist[mxN][mxN];
void solve() {
int n; cin >> n;
vector<pt> pts(n);
for(auto& i : pts) read(i);
pt b; read(b);
for(int i=0;i<n;++i) fill(dist[i],dist[i]+n,oo);
for(int i=0;i<n;++i) {
for(int j=0;j<n;++j) {
if(ccw(pts[i],pts[j],b)>0) {
dist[i][j] = sqrt(norm(pts[i]-pts[j]));
}
}
}
for(int j=0;j<n;++j) for(int i=0;i<n;++i) for(int k=0;k<n;++k) {
dist[i][k] = min(dist[i][k], dist[i][j]+dist[j][k]);
}
double ans = oo;
for(int i=0;i<n;++i) ans=min(ans,dist[i][i]);
if(ans!=oo) cout << setprecision(15) << ans << '\n';
else cout << "IMPOSSIBLE\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T; cin >> T;
for(int i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ludCBpPTA7aTxuOysraSkgZm9yKGludCBrPTA7azxuOysraykgewogICAgICAgIGRpc3RbaV1ba10gPSBtaW4oZGlzdFtpXVtrXSwgZGlzdFtpXVtqXStkaXN0W2pdW2tdKTsKICAgIH0KICAgIGRvdWJsZSBhbnMgPSBvbzsKICAgIGZvcihpbnQgaT0wO2k8bjsrK2kpIGFucz1taW4oYW5zLGRpc3RbaV1baV0pOwogICAgaWYoYW5zIT1vbykgY291dCA8PCBzZXRwcmVjaXNpb24oMTUpIDw8IGFucyA8PCAnXG4nOwogICAgZWxzZSBjb3V0IDw8ICJJTVBPU1NJQkxFXG4iOwp9CmludCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBjaW4udGllKE5VTEwpOwogICAgaW50IFQ7IGNpbiA+PiBUOwogICAgZm9yKGludCBpPTE7aTw9VDsrK2kpIHsKICAgICAgICBjb3V0IDw8ICJDYXNlICMiIDw8IGkgPDwgIjogIjsKICAgICAgICBzb2x2ZSgpOwogICAgfQp9