UVA10558 A Brief Gerrymander

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1499 [PDF](https://uva.onlinejudge.org/external/105/p10558.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10558/09c80be413b946cf2577891e7d74e676d917dd78.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10558/69def0b295f1499d0d23b4b6aacb24bb19a36eae.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10558/0d0c9a71a12971670411e99452146cd824f4572e.png)