UVA12746 Reconstructing the Grid

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=823&page=show_problem&problem=4599 [PDF](https://uva.onlinejudge.org/external/127/p12746.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12746/92875af46ecbfc2ba1338eaf4d29f30380a3cc41.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12746/50fbe5a2b89796e154ac1e8af112ed8d47ad9014.png)