#include <bits/stdc++.h>
#define LL long long
#define FOR(i,c) for(__typeof(c.begin()) i = c.begin(); i != c.end(); i++)
#define F first
#define S second
using namespace std;
const LL mod = 1e9 + 7;
template<typename T> T gcd(T a, T b) { return b == 0?a: gcd(b, a % b); }
template<typename T> T LCM(T a, T b) { return a*(b/gcd(a, b)); }
template<typename T> T expo(T base, T e, T mod) { T res = 1;
while(e > 0) { if(e&1) res = res * base % mod; base = base * base % mod; e >>= 1; }
return res;
}
template<typename T, typename S> T expo(T b, S e){if(e <= 1)return e == 0?1: b;\
return (e&1) == 0?expo((b*b), e>>1): (b*expo((b*b), e>>1));}
template<typename T, typename S> T modinv(T a, S mod) { return expo(a, mod-2, mod); }
template<class T, class S> std::ostream& operator<<(std::ostream &os, const std::pair<T, S> &t) {
os<<"("<<t.first<<", "<<t.second<<")";
return os;
}
template<class T> std::ostream& operator<<(std::ostream &os, const std::vector<T> &t) {
os<<"["; FOR(it,t) { if(it != t.begin()) os<<", "; os<<*it; } os<<"]";
return os;
}
const int MAXN = 11;
const int ACC = 50;
const double EPS = 1e-7;
int n;
double P, H;
double x[MAXN], y[MAXN];
double dist(double x1, double y1, double x2, double y2) {
return sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
}
double dist(pair<double, double> a, pair<double, double> b) {
return sqrt((a.F - b.F)*(a.F - b.F) + (a.S - b.S)*(a.S - b.S));
}
double dist_at(double a, double x, double cx, double cy) {
double y = a * x * (x - P);
return dist(x, y, cx, cy);
}
pair<double, double> closest(double a, double cx, double cy) {
pair<double, double> res;
double lower = 0, upper = P, f1, f2;
if(fabs(cx - P/2.0l) < EPS) {
lower = 0, upper = P/2.0l;
}
for(int i = 0; i < ACC; i++) {
f1 = lower + (upper - lower)/3.0l;
f2 = f1 + (upper - lower)/3.0l;
if(dist_at(a, f1, cx, cy) < dist_at(a, f2, cx, cy)) {
upper = f2;
} else {
lower = f1;
}
}
res.F = (lower + upper)/2;
res.S = a * res.F * (res.F - P);
return res;
}
// Open = -1
// Close = 1
bool fixR(double r) {
vector<pair<double, int> > events;
for(int i = 0; i < n; i++) {
double curr_x = x[i], curr_y = y[i];
double lower = - (curr_y / (curr_x * (P - curr_x))), upper = 0, a;
for(int iter = 0; iter < ACC; iter++) {
a = (lower + upper) / 2.0l;
// Given a, and center of circle, find closest point on parabola
pair<double, double> onp = closest(a, curr_x, curr_y);
double D = dist(onp.F, onp.S, curr_x, curr_y);
if(D < r) {
lower = a;
} else {
upper = a;
}
}
a = (lower + upper) / 2.0l;
if(fabs(dist(closest(a, curr_x, curr_y), {curr_x, curr_y}) - r) < EPS) {
events.push_back({0.0l, -1});
events.push_back({a, 1});
}
lower = 4.0l * (r - H) / (P*P), upper = - (curr_y / (curr_x * (P - curr_x)));
if(lower <= upper) {
for(int iter = 0; iter < ACC; iter++) {
a = (lower + upper) / 2.0l;
pair<double, double> onp = closest(a, curr_x, curr_y);
double D = dist(onp.F, onp.S, curr_x, curr_y);
if(D < r) {
upper = a;
} else {
lower = a;
}
}
a = (lower + upper) / 2.0l;
if(fabs(dist(closest(a, curr_x, curr_y), {curr_x, curr_y}) - r) < EPS) {
events.push_back({a, -1});
events.push_back({4.0l * (r - H) / (P*P), 1});
}
}
}
int have = 0;
sort(events.begin(), events.end(), [&](const pair<double, int> &lhs,
const pair<double, int> &rhs) {
if(fabs(lhs.F - rhs.F) < EPS) return lhs.S < rhs.S;
return lhs.F > rhs.F;
});
for(auto &elem: events) {
have += elem.S;
if(have == -n) {
return true;
}
}
return false;
}
int main() {
ios_base::sync_with_stdio(false);
int t;
cin >> t;
for(int tc = 1; tc <= t; tc++) {
cout << "Case #" << tc << ": ";
cin >> n >> P >> H;
for(int i = 0; i < n; i++) {
cin >> x[i] >> y[i];
}
double lower = 0, upper = H, mid;
for(int i1 = 0; i1 < ACC; i1++) {
mid = (lower + upper) / 2.0l;
if(fixR(mid)) {
lower = mid;
} else {
upper = mid;
}
}
mid = (lower + upper) / 2.0l;
cout << setprecision(8) << fixed << mid << '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