1 #include <bits/stdc++.h>
2 using namespace std;
3 int n;
4 double d;
5 double p,l,v,ret,sum;
6 int cnt =1;
7 /*
8
9 村庄A,B之间有若干条河流,每条河流上的船速各自保持不变。告诉河流条数,两个村庄之间的距离
10 以及每条河流的距离A村庄的位置,宽度,船的速度。求A到B的时间的期望。
11
12 过河:最多用时:3*l/v,最少用时l/v。
13 因为开始时船的位置随机,所以期望过河时间为2L/v。加上在路上行走的时间就是答案。
14 */
15 int main()
16 {
17 while(~scanf("%d%lf",&n,&d)){
18 if(n+d==0) break;
19 ret= 0.0;sum = 0.0;
20 for(int i =0;i<n;i++){
21 scanf("%lf%lf%lf",&p,&l,&v);
22 sum+=l;
23 ret+=2.0*l/v;
24 }
25 ret+=(d-sum);
26 printf("Case %d: %.3f\n\n",cnt++,ret);
27 }
28 return 0;
29 }