#include #include #include #include #include using namespace std; const int maxn = 200; int n,b; double c; int main() { int T; scanf("%d",&T); while(T--){ scanf("%d",&n); double mi = -10; for( int i = 1; i <= n; i++ ){ scanf("%d%lf",&b,&c); mi = max( mi , (1-c)/(b+1-c) ); } printf("%0.5f\n",mi ); } return 0; }