#include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) int main(){ ll n ; cin >> n ; rep(i,n){ long double a , b , c ; cin >> a >> b ; c = sqrt(a) + sqrt(b) ; ll c_ll = (ll) c ; cout << c_ll + 1 << endl ; } }