UVA12215 Rectangle of Permutation

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=244&page=show_problem&problem=3367 [PDF](https://uva.onlinejudge.org/external/122/p12215.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12215/e5a97cdb6475165c0104dc0cb9bdb3d08bfc436f.png)

Input Format

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

Output Format

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