UVA10085 The most distant state

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1026 [PDF](https://uva.onlinejudge.org/external/100/p10085.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10085/02098931061f9d807a4959389ad4db874b3d8df0.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10085/3e7d6eb0298fadbf7430825d609af27db908a4c3.png)