#include using namespace std; using ll = long long; const ll mod=998244353; using vll =vector; using vvll =vector; #define all(A) A.begin(),A.end() #define rep(i,n) for(int i=0;i 1) { ll mid = (R +L) / 2; if (mid * mid <= N)L = mid; else R = mid; } return L; } ll gcd(ll(a), ll(b)) { if (a == 0)return b; if (b == 0)return a; ll c = a; while (a % b != 0) { c = a % b; a = b; b = c; } return b; } int main(){ vector> P; ll N=1e6/4; vector>> G; for(ll i=1;i<=600;i++){ for(ll j=i+1;j<=600;j++){ ll g=gcd(i,j); if(g!=1)continue; G.push_back({double(i)/double(j),{i,j}}); G.push_back({double(j)/double(i),{j,i}}); if(G.size()==N)break; } } sort(all(G)); reverse(all(G)); P.push_back({-1e9+1,-1}); rep(i,N-1){ ll x=P.back().first; ll y=P.back().second; ll nx=x+G[i].second.first; ll ny=y-G[i].second.second; P.push_back({nx,ny}); } N=P.size(); for(ll n=N-1;n>=0;n--){ P.push_back({-P[n].first,P[n].second}); } N=P.size(); for(ll n=N-1;n>=0;n--){ P.push_back({P[n].first,-P[n].second}); } cout<