/*
	[NWERC'10] HILL TRAVEL
	by: Jan Kuipers
*/

#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>

using namespace std;

int main () {

	int runs;
	cin>>runs;

	while (runs--) {

		double a,b,vmax,f;
		int N;
		cin>>a>>b>>vmax>>f>>N;
		
		vector<double> d(N),s(N);
		for (int i=0; i<N; i++) {
			double dx,dy;
			cin>>dx>>dy;
			d[i] = sqrt(dx*dx+dy*dy) / 1000;
			s[i] = dy/dx;
		}

		double lo=0,hi=vmax;
		
		for (int times=0; times<1000; times++) {

			double v=(lo+hi)/2;

			double fuel=0;
			for (int i=0; i<N; i++) 
				fuel += max(0.0, d[i]*(a*v + b*s[i]));
			if (fuel>f) hi=v; else lo=v;
		}

		if (lo<1e-100)
			cout << "IMPOSSIBLE" << endl;
		else {
			double time=0;
			for (int i=0; i<N; i++) {
				double v = lo;
				if (a*v+b*s[i] < 0) v = min(vmax, -b*s[i]/a);
				time += d[i]/v;
			}
			cout << setprecision(10) << time << endl;
		}
	}
	
	return 0;
}

