#include #include #include #include using namespace std; const int LIM=2e5; long B[LIM]; long cnt[LIM]; bool f(pairp,pairq) {//p2*(d-b)*(d-b); else return true; } else { if(d-b<0)return false; else return (a-c)*(a-c)<2*(d-b)*(d-b); } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); B[0]=1; cnt[0]=1; for(int c=1;c>N; if(N==1) { cout<<"0 0\n"; return 0; } N-=1; long R=0; long b=0; while(true) { R++; while(2*(b+1)*(b+1)<=R*R)b++; if(N<=b+1)break; N-=b+1; } vector >A; long a=R;b=0; A.push_back(make_pair(a,b)); while(a>0) { a--; if(!f(make_pair(R-1,0),make_pair(a,b)))b++; A.push_back(make_pair(a,b)); } sort(A.begin(),A.end(),f); assert(N<=A.size()); cout<