#include #include using namespace std; using namespace atcoder; using ll = int_fast64_t; using ull = uint_fast64_t; using mint = modint998244353; constexpr ll INF = 1ll << 60; #define iscontain(container, value) (find(container.begin(), container.end(), value) != container.end()) template void printelem(const T& container, const D& divide){ for(const auto& i : container) cout << i << divide; cout << endl; } template void printelem(const T& container) { printelem(container, ", "); } template T input(){ T ret; cin >> ret; return ret; } int main(){ //インプット ll N; cin >> N; vector A(N), B(N); for(ll i = 0; i < N; i++) cin >> A[i] >> B[i]; //アウトプット for(ll i = 0; i < N; i++){ ll ans = sqrt(A[i]) + sqrt(B[i]) + 1; cout << ans << endl; } return 0; }