UVA10097 The Color Game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1038 [PDF](https://uva.onlinejudge.org/external/100/p10097.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10097/9ad1890ca3f10fc913ece9c3a2ed5a1230c6077e.png)

Input Format

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

Output Format

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