mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
18 lines
371 B
C++
18 lines
371 B
C++
|
#include<stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
int n, i, cas = 0, d, p, l, v;
|
||
|
while(~scanf("%d%d",&n,&d), n+d)
|
||
|
{
|
||
|
double ans = d*1.0;
|
||
|
for(i = 0; i < n; i++)
|
||
|
{
|
||
|
scanf("%d%d%d",&p, &l, &v);
|
||
|
ans -= l;
|
||
|
ans += 2.0*l / v;
|
||
|
}
|
||
|
printf("Case %d: %.3lf\n\n",++cas, ans);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|