#include #define int long long using namespace std; const int N=2000010; const int mod=1e9+7; struct Node{ int x,y; double f; }a[N]; int id; bool cmp(Node a,Node b){ return a.f>p; double x; f=modf(p,&x);//???? if(!print(p,f,0,999999*f))print(p,f+1,999999*f,999999); return; } signed main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); for(int i=1000;i<2000;i++){ for(int j=0;j<1000;j++){ double x=sqrt(i)+sqrt(j); double f=modf(x,&x);//?????? a[id].x=i;a[id].y=j;a[id].f=f; id++; } } sort(a,a+id,cmp); int Tc=1; cin>>Tc; while(Tc--)solve(); return 0; } /* */