UVA12341 Next to Never

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=278&page=show_problem&problem=3763 [PDF](https://uva.onlinejudge.org/external/123/p12341.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12341/38d5d07edd084be564b814b2e036d13b9980496d.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12341/97a4045b2b49f6c689da61624edec918a9bdcb0e.png)