//Mitesh Agrawal
#include <bits/stdc++.h>
using namespace std;
#define ii pair<ll,ll>
#define dd pair<double,ll>
#define ll long long
ll n,k;
ii cake[1005];
dd dp[1005][1005];
//ans, last index
dd f(ll idx, ll req){
ll i,j;
dd &ans = dp[idx][req];
dd ans1, ans2;
if(ans != dd(-1,-1)) return ans;
if(req == 0) return ans = ii(0,-1);
if(idx + 1 == req){
ans.first = M_PI * cake[idx].first * cake[idx].first;
for(i = 0; i <= idx; i++)
ans.first += M_PI * 2.0 * cake[i].first * cake[i].second;
ans.second = idx;
return ans;
}
ans1 = f(idx - 1, req);
ans2 = f(idx - 1, req - 1);
if(ans2.second > -1)
ans2.first -= M_PI * cake[ans2.second].first * cake[ans2.second].first;
ans2.first += M_PI * cake[idx].first * cake[idx].first;
ans2.first += M_PI * 2.0 * cake[idx].first * cake[idx].second;
ans2.second = idx;
return ans = max(ans1, ans2);
}
int main(){
ll i,j,test,t;
scanf("%lld",&t);
for(test = 1; test <= t; test++){
scanf("%lld %lld",&n,&k);
for(i = 0; i < n; i++)
scanf("%lld %lld",&cake[i].first, &cake[i].second);
sort(cake, cake+n);
for(i = 0; i <= n; i++)
for(j = 0; j <= k; j++)
dp[i][j] = dd(-1, -1);
printf("Case #%lld: %0.12lf\n",test, f(n-1, k).first);
}
return 0;
}
Ly9NaXRlc2ggQWdyYXdhbAojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNkZWZpbmUgaWkgcGFpcjxsbCxsbD4KI2RlZmluZSBkZCBwYWlyPGRvdWJsZSxsbD4KI2RlZmluZSBsbCBsb25nIGxvbmcKCmxsIG4sazsKaWkgY2FrZVsxMDA1XTsKZGQgZHBbMTAwNV1bMTAwNV07CgovL2FucywgbGFzdCBpbmRleApkZCBmKGxsIGlkeCwgbGwgcmVxKXsKCWxsIGksajsKCWRkICZhbnMgPSBkcFtpZHhdW3JlcV07CglkZCBhbnMxLCBhbnMyOwoJaWYoYW5z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