#include #include #define rep(i,n) for(int i=0;i P; typedef vector vi; constexpr ll inf=1ll<<61; constexpr ll mod=998244353; typedef modint998244353 mi; int main(){ int n;cin>>n; rep(i,n){ ll a,b;cin>>a>>b; ll lb=0,ub=70000; while(ub-lb>1){ ll mi=(ub+lb)/2; if(mi*mi-a-b<0)lb=mi; else{ if(4*a*b<(mi*mi-a-b)*(mi*mi-a-b))ub=mi; else lb=mi; } } cout<