过河 Crossing Rivers

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=244&page=show_problem&problem=3382 [PDF](https://uva.onlinejudge.org/external/122/p12230.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12230/b612c63e18559127bd3e854aaaeb5bcd863c134d.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12230/56253f5b6e8906f830ef43cf2037f78e517ddedc.png)

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12230/9be4ff92b94be5587ca0487cbf72ef3c509536dc.png)

输入输出样例

输入样例 #1

1 1
0 1 2
0 1
0 0

输出样例 #1

Case 1: 1.000
Case 2: 1.000