#include <bits/stdc++.h>
using namespace std;
#define ins insert
#define pb push_back
#define vi vector <int>
#define vl vector<long long int>
#define pi pair<int, int>
#define pii pair<int, pair <int ,int> >
#define pl pair<long long int , long long int>
#define ll long long
#define pll pair<ll,pair <ll,ll> >
#define er erase
#define mp make_pair
#define cl clear
#define maii map<int, int>
#define Si(a) scanf("%d",&a)
#define Slf(a) scanf("%lf",&a)
#define Sull(a) scanf("%llu",&a)
#define rep(i,k,n,l) for(int i = k; i < n; i=i+l)
#define PI 3.14159265358979323846264
#define ull unsigned long long
#define MOD 100000007
ull gcd(ull a, ull b)
{
if (a == 0)
return b;
return gcd(b%a, a);
}
double n,m,k,ra;
double bs(double ans) {
double hi = n;
double lo = 1/ans;
//cout << "hi/lo = " << hi/lo << endl;
while((hi/lo) > 1.00000001) {
double mid = (lo+(hi-lo)/2);
//cout << "hi/lo = " << hi/lo << endl;
//cout << "lo = " << lo << " " << hi << endl;
//cout << "ans = " << ans <<" and square = " << mid/n << endl;
double tmp = mid/n;
double k = tmp/n;
if(mid/n <= ans) {
//cout << "mid = " << mid*mid << endl;
lo = mid;
}
else {
hi = mid-0.00000001;
}
}
//cout << "lo " << lo << endl;
return lo;
}
int main() {
//freopen("/home/nalin/Desktop/codes/input.txt","r", stdin);
int t,lt = 1;
Si(t);
while(lt <= t) {
Slf(n);Slf(m);Slf(k);Slf(ra);
double ans = (ra/(ra+1));
//cout << "ans = " << ans << endl;
//cout << "ra = " << sqrt(ans) << endl;
double findsqrt =bs(sqrt(ans));
//cout << bs(ra) << endl;
double fa = findsqrt;
printf("Case %d: %0.6lf\n",lt ,fa);
lt++;
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBpbnMgaW5zZXJ0CiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgdmkgdmVjdG9yIDxpbnQ+CiNkZWZpbmUgdmwgdmVjdG9yPGxvbmcgbG9uZ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