#include using namespace std; int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int T; cin >> T; while(T--) { int n; cin >> n; double ans(0.0); while(n--) { double b, c; cin >> b >> c; ans = max(ans, (1 - c) / (b + 1 - c)); } cout << fixed << setprecision(5) << ans << endl; } return 0; }