Codeforce 1114 D Flood Fill (DP)
Source
will download...
Codeforce 1114 D Flood Fill (DP)