UVA10081 Tight Words

Description

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

Input Format

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

Output Format

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