//No.98 円を描こう #pragma GCC optimize("O3") #pragma GCC target("avx") #include #define rep(i ,n) for(int i=0;i<(int)(n);++i) using namespace std; signed main(){ int px , py; cin >> px >> py; double dist = sqrt( px * px + py * py); double d = fabs(dist - static_cast(dist)); if( d >= 0.5 ) cout << ceil(dist) * 2 << endl; else if ( d == 0.0) cout << static_cast(dist)*2 + 1 << endl; else if( d > 0.0 && d < 0.5) cout << static_cast(d * 2) << endl; }