UVA11655 Waterland

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=78&page=show_problem&problem=2702 [PDF](https://uva.onlinejudge.org/external/116/p11655.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11655/5fb949d20780c1348eef0296c0979e88f24d125e.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11655/4e7555aec98e326cb9f022b0d12fe6662212840a.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11655/6e51bb1d076e562d18b219f6849c211338f29529.png)