상한 1e10으로 하니까 accept 받네,,,

이거 나가서 탈락했는데 너무 아쉽다 ㅠ


void process(int tc) {

ll L, R; scanf("%lld%lld", &L, &R);

int f = 0;

if (L

ll ans = 0, s = 0, e = 1e9, m, c = L - R, r;

while (s <= e) {

m = (s + e) / 2LL;

if (m * (m + 1) / 2LL <= c) {

s = m + 1;

ans = m;

}

else e = m - 1;

}



L -= ans * (ans + 1LL) / 2LL;

if (f && L == R)f = 0;

if (ans + 1LL <= L) {

s = 1; e = 1e9; r = 0;

while (s <= e) {

m = (s + e) / 2LL;


if (ans + m <= L / m) {

s = m + 1;

r = m;

}

else e = m - 1;

}

m = r;


L -= m * (ans + m);

if (R >= m * (ans + m + 1LL)) {

R -= m * (ans + m + 1LL);

ans++;

}

else R -= (m - 1LL) *(ans + m);

ans += 2LL * (m - 1LL) + 1LL;

}

if (f) swap(L, R);

printf("Case #%d: %lld %lld %lld\n", tc, ans, L, R);

}