UVA10937 Blackbeard the Pirate

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1878 [PDF](https://uva.onlinejudge.org/external/109/p10937.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10937/a09e395e3f08548c6f42c4a6a0881abf57797c2a.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10937/0b2026f667e177e3056e03ad5e48cc576fcad6bc.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10937/c86e83f1fe8562fa34cbf08dc1547eadbd0c5708.png)