Introduction - If you have any usage issues, please Google them yourself
Rules of the game is given a 4 × 4 chessboard, put a coin for each grid,
May be right side up, it could be negative up. If you want to flip a coin which, with its adjacent up and down
Coins if present, must also flip, collectively referred to as a flip. Now the board is given the initial release of coins
Home state and target placement status, calculation, at least how many times can flip a coin on the board-like from the initial placement
State into a goal of placing state.
Input: Enter the first line containing a positive integer k, the number of said groups of test cases. Then the following set of test cases k data.
Each group consists of two 4 × 4 array of 0-1, separated by a blank line, respectively, the board said the initial goal of placing state and put
Home state. Data in the same line separated by a space between the two groups of test cases separated by a blank line between.
Output: corresponding to each test case output an integer that represents the least n