#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; } long L=0,R=LIM-1; while(R-L>1) { long mid=(L+R)/2; if(cnt[mid]>=N)R=mid; else L=mid; } vector >A; N-=cnt[L]; long a=R,b=0; A.push_back(make_pair(a,b)); while(a>0) { a--; if(!f(make_pair(L,0),make_pair(a,b)))b++; A.push_back(make_pair(a,b)); } sort(A.begin(),A.end(),f); assert(N<=A.size()); cout<