UVA11111 Generalized Matrioshkas

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=23&page=show_problem&problem=2052 [PDF](https://uva.onlinejudge.org/external/111/p11111.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11111/6aaab06a5a9302dd3ecfd46a2738a45e9ea4c2c9.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11111/535ffee402132a6b01794340988eb5bdbbc12333.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11111/5f958cecf3bce94266ab457cf8f96bc21019d480.png)