#include using namespace std; const long double EPS = 1e-14; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; while(n--){ long double a, b; cin >> a >> b; cout << (int) ceil(sqrtl(a) + sqrt(b) + EPS) << endl; } }