UVA10566 Crossed Ladders

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1507 [PDF](https://uva.onlinejudge.org/external/105/p10566.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10566/04bd930627e82cc986e14b41bdaa0b69d1b37635.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10566/3754046125e48d80d182db37d7cf4ad07235fd79.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10566/4551903c4aac4c95f56b92a3629e8f0e97337487.png)