Fill each square of an N by M board with one of four colors so that orthogonal neighbors differ, maximizing total beauty and counting optimal placements modulo 1e9+7.
Hard8Dynamic programmingBacktrackingCombinatoricsImplementationNo attempts yetTime limit3sMemory limit128 MB