UVA107 The Cat in the Hat

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=43 [PDF](https://uva.onlinejudge.org/external/1/p107.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA107/51e891d5a3455e81473888dd3c683533df825f6c.png)

Input Format

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

Output Format

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