NC24443. [USACO 2016 Ope P]Bull in a China Shop
描述
输入描述
The first line contains a single integer K. Following that will be K+1 piece descriptions. The first description will describe the original glass cow, the following K descriptions will be of the broken pieces.
Each description begins with a line containing two integers R and C (1≤R,C≤100). The following R lines contain C lowercase alphabet characters describing the color of each cell. Each piece will be horizontally/vertically connected and have at least one non-empty cell.
输出描述
Output the number of triples i,j,k (i
示例1
输入:
5 5 5 aaaaa ..a.. bbabb ..a.. aaaaa 3 5 ..abb ..a.. aaaaa 5 2 a. a. aa a. a. 1 2 bb 1 5 bbabb 2 5 aaaaa ..a..
输出:
3
说明:
The three solutions use pieces (0,1,2)(0,1,2), (0,2,4)(0,2,4), (1,3,4)(1,3,4).