For each case, first please output "Case #k: ", k is the number of test case. See sample output for more detail. Then, please output the length of Γ with exactly 4 digits after the decimal point.
//qscqesze
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <bitset>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 100006
#define mod 1000000007
#define eps 1e-9
#define e exp(1.0)
#define PI acos(-1)
const double EP = 1E-10 ;
int Num;
//const int inf=0x7fffffff;
const ll inf=999999999;
inline ll read()
{
ll x=0,f=1;char ch=getchar();
while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
return x*f;
}
//*************************************************************************************
int main()
{
int t=read();
for(int cas=1;cas<=t;cas++)
{
double x1,y1,x2,y2,x3,y3;
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
double a = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
double b = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
double c = sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
double k = acos((a*a+b*b-c*c)/(2.0*a*b));
double ans = cos(0.5*k)*a;
//cout<<k<<endl;
double h = cos(0.5*k)*a;
double r = (a*c)/(h*2.0);
ans += r*((double)PI-k);
/*
if(k<=PI/2.0)
ans += k*a;
else
{
double aa = a;
double bb = cos(0.5*k)*a;
double cc = c/2.0;
double h = 2.0*bb*cc/aa;
double kk = acos(h/aa);
double kkk = k - 4.0*kk;
kkk = max(0.0,kkk);
ans += kkk*a;
}
*/
printf("Case #%d: %.4lf\n",cas,ans);
}
}