UVA11276 Magical Seven

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2251 [PDF](https://uva.onlinejudge.org/external/112/p11276.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11276/8b4016fb783cdea1bda224c0dbc0b9619661b667.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11276/9551672952a6646574568c6ee4d9c7f3b0f3349c.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11276/4afa781cb6901fbdb8a82e04ad6dfea88ae9f017.png)