import java.math.*; import java.util.*; import static java.lang.Math.*; import static java.math.BigDecimal.*; public class Main { private static final long MAX_VALUE = (long)pow(10, 18); private static final int N = 100000; private long calc(long d) { return (long)((-1 + sqrt(1+4*d)) / 2.0); } private long correct(long d) { long lo = 0, hi = d + 1; while(hi - lo > 10) { long md = (lo + hi) / 2; if(md > Integer.MAX_VALUE) { hi = md; continue; } if(md*md + md <= d) { lo = md; } else { hi = md; } } for(long t=lo; t<=hi; ++t) { if(t*t + t <= d && d < (t+1)*(t+1) + (t+1)) { return t; } } throw new RuntimeException("(;ω;)"); } private void solve() { for(long k=112345678L, cnt=0; cnt