#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,1,1000000*f))print(p,f+1,1000000*f,1000000); 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);//?????? id++; a[id].x=i;a[id].y=j;a[id].f=f; } } sort(a+1,a+id+1,cmp); int Tc=1; cin>>Tc; while(Tc--)solve(); return 0; } /* */