UVA12007 Crossboard Coloring

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=242&page=show_problem&problem=3158 [PDF](https://uva.onlinejudge.org/external/120/p12007.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12007/3a6fc49dfaf76c5128c7ba270604ec2885546970.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12007/413a6e3311ccf34429de33fc6be44780c470034f.png)

Output Format

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