Stamp Stamp

No attempts yetTime limit10sMemory limit256 MB

Problem

There is a rectangular stamp. A cell of the stamp that carries ink is written as '#', and a cell that carries no ink is written as '.'. Here is one example of a stamp.

..#..#..
.######.
..#..#..

The stamp is pressed on a blank paper exactly twice. Neither the paper nor the stamp is rotated, the stamp stays parallel to the sides of the paper, and the stamp never hangs over the edge of the paper. The two positions can be the same or different.

Every paper cell touched by a '#' cell of the stamp receives ink and becomes '#'. A cell touched by a '.' cell of the stamp stays as it is, so a cell that already has ink keeps its '#'. A cell inked twice looks exactly like a cell inked once.

The paper after the two presses is given. Among all stamps that can produce this paper, find the one with the fewest '#' cells and report how many there are.

The picture below is one paper the stamp above can produce.

..#..#..
.######.
.######.
..#..#..

Input

The first line contains the number of test cases TT (1T1001 \le T \le 100). The first line of each test case contains the height LL and the width WW of the paper (1L,W3001 \le L, W \le 300). The next LL lines each contain a string of length WW. Each string consists of '.' and '#' only, where '#' is an inked cell and '.' is an empty cell.

Output

For each test case, print on one line the fewest '#' cells a stamp that produces the paper can have. Print 0 when the paper has no inked cell.