UVA11611 Colored Tiles

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=78&page=show_problem&problem=2658 [PDF](https://uva.onlinejudge.org/external/116/p11611.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11611/c9a5dc9b8ba9dda2e07f42a65510853c3f199c43.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11611/3a90e199b31ae82d5f3b9db947d87b939eded4d5.png)

Output Format

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