#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return x*f;
}
const double eps=1e-6;
int n,D,H;
int d[1100],h[1100];
bool check(double mid){
	double k=(H-mid)/D,b=mid;
	for(int i=1;i<=n;++i){
		if(1.0*d[i]*k+b<h[i]){
			return false;
		}
	}
	return true;
}
int main(){
	n=read(),D=read(),H=read();
	for(int i=1;i<=n;++i){
		d[i]=read(),h[i]=read();
	}
	double l=0,r=1000;
	while(r-l>eps){
		double mid=(l+r)/2;
		if(check(mid)){
			r=mid;
		}else{
			l=mid;
		}
	}
	printf("%.6f\n",l);
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define N 214514
const ll mod = 100000;
const ll inf = 1000000000000000000;

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
int main() {
    ll t;
    cin >> t;
    vector<ll> ans;
    while (t--) {
        ll n, s, k;
        cin >> n >> s >> k;
        ll x = __gcd(k, __gcd(n - s, n));

        if (__gcd(k / x, n / x) != 1)
            ans.push_back(-1);
        else {
            ll y = modinv(k / x, n / x);
            ans.push_back((n - s) / x * y % (n / x));
        }
    }
    for (ll x : ans) cout << x << endl;
    return 0;
}