#include using namespace std; const long double EPS = 5e-15; // >_< 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; } }