#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); long long R,B; cin >> R >> B; if(R > B) swap(R,B); long long S2 = -1; long long n = 13,n2 = 1< Se; for(long long i=0; i sum){ans = i-1; break;} now += i*i; } if(*itr < R || Se.count(R)) cout << ans << endl; else{ long long maxs = 0; for(auto s : Se){ if(s > R) break; maxs = s; } now -= maxs; if(now > B) cout << ans-1 << endl; else cout << ans << endl; } }