UVA12790 The "Win-stay and Lose-shift" Strategy

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=823&page=show_problem&problem=4655 [PDF](https://uva.onlinejudge.org/external/127/p12790.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12790/0f7389d079aea1d5c9c35fe118050d572676a55a.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12790/222dcae513ed31d7e9c272b4f648b8de35850244.png)