UVA11380 Down Went The Titanic

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=25&page=show_problem&problem=2375 [PDF](https://uva.onlinejudge.org/external/113/p11380.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11380/4930d00c5f8453d85085cdda1487017730379d18.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11380/07c4390dc8f2e9bcbea6325bd6ae65250eeed71f.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11380/35f9872c9008d2acab027d3f4b06dfea896fc1d0.png)