UVA12122 Infinite Matrix

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=243&page=show_problem&problem=3274 [PDF](https://uva.onlinejudge.org/external/121/p12122.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12122/425f2a77df784b84c8a653c040216ddab09bf1e5.png)

Input Format

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

Output Format

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