#include using namespace std; int main(void) { int64_t A, B, mid,ok = 1e5, ng = 2; cin >> A >> B; while (abs(ok - ng) > 1) { mid = (ok + ng) / 2; int64_t Y = ((mid * mid) - A - B); if (4 * A * B < Y * Y && mid * mid > A + B) { ok = mid; } else { ng = mid; } } cout << ok << endl; }