White Rabbit will choose a subrectangle
Then
White Rabbit must ensure that
You need to find the minimum cost way.
The first line of input contains two integers
For the next line oflines, each line contains
lowercase English characters, denoting
.
For the next line oflines, each line contains
integers in range [0,1000000000], denoting
.
Print the minimum cost.
2 5 acaca acaca 3 9 2 8 7 4 5 7 3 1
18
choose subrectangle colorA[1...1][3...4]=ca, After copying unlimited copies
colorC=
cacacacaca ...
cacacacaca ...
cacacacaca ...
cacacacaca ...
cacacacaca ...
.........
colorA is a subrectangle of colorC
the cost is max(3,1)*(1+1)*(2+1).