题目描述
You are given a rectangular grid with nn rows and mm columns. The cell located on the ii -th row from the top and the jj -th column from the left has a value a_{ij}aij written in it.
You can perform the following operation any number of times (possibly zero):
- Choose any two adjacent cells and multiply the values in them by -1−1 . Two cells are called adjacent if they share a side.
Note that you can use a cell more than once in different operations.
You are interested in XX , the sum of all the numbers in the grid.
What is the maximum XX you can achieve with these operations?
输入格式
Each test contains multiple test cases. The first line contains the number of test cases tt ( 1 \le t \le 1001≤t≤100 ). Description of the test cases follows.
The first line of each test case contains two integers nn , mm ( 2 \le n2≤n , m \le 10m≤10 ).
The following nn lines contain mm integers each, the jj