解法:
#include<bits/stdc++.h>
using namespace std;
const int N=1e3+3;
struct P{int x,y;
}a[N];
int main(int argc, char** argv) {int t,n;cin>>t;while (t--){cin>>n;for (int i=0;i<n;i++) cin>>a[i].x>>a[i].y;double dis,mn=1e5;for (int i=0;i<n;i++){for (int j=i+1;j<n;j++){dis=sqrt(pow(a[i].x-a[j].x,2)+pow(a[i].y-a[j].y,2));mn=min(dis,mn);}}printf("%.4lf\n",mn);}return 0;
}