On the Subject of Gerrymandering

"Your opinion doesn't matter" - gerrymanderers, probably.

  • There are N squares (“voters”) on the module (n is the number on the top-right of the module).
  • n is equal to the product of 2 factors (x × y).
  • Divide the board into x groups of y squares each such that:
    • y is the largest possible factor among all possible pairs of (x, y) but is less than 10. Example: 45 = 1 × 45 = 3 × 15 = 5 × 9; in this case y = 9.
    • Each group only consists of orthogonally adjacent squares.
    • The colour at the top of the module wins majority of the groups. A colour wins a group if it is prevalent in that group.
  • The module cannot strike nor there is a button to clear the input. (However, you can always override current input).