UVA589 Pushing Boxes

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=530 [PDF](https://uva.onlinejudge.org/external/5/p589.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA589/d33446a08a4244cfb7aec9ce86c82cfa17d5eedd.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA589/1dadf6a5495004e555a45d227e6620a1d0a547a5.png)