UVA10998 Flipping Colors

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1939 [PDF](https://uva.onlinejudge.org/external/109/p10998.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10998/58ea8335224aeb2cf7c9f233f973e37b5dff0e2b.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10998/5123e6954b3f75e0f0e6c972cbd90fcee9350acf.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10998/0185b0328c079866020f8b94507e8701499ab8be.png)