문제
You are given an matrix of R rows and C columns. All elements of the matrix are by their absolute value smaller than or equal to 104. You may perform the following operations: Operation Notation Example Rotate i-th row of the matrix k elements right rotR i k rotR 3 1 → Rotate j-th column of the matrix k elements down rotS j k rotS 3 2 → Multiply all elements in the i-th row by -1, if and only if none of them were multiplied before. negR i negR 2 → Multiply all elements in j- th column by -1, if and only if none of them were multiplied before. negS j negS 1 → Using limited number of these operations, you need to maximize the sum of all the elements of the matrix.
입력
The first line of input contains two integers R and C (1 ≤R, C ≤100), number of rows and columns. The next R lines contain C integers each. All integers are by their absolute value smaller than 104.
출력
The first line of output should contain two integers, the maximal sum obtainable and the number of operations used. We shall call this number T. The next T lines should contain any sequence of operations leading to the sum. Each operation should follow the notation defined in the table below. For details look at sample test cases.
예제 입력 1
3 4
1 -2 5 200
-8 0 -4 -10
11 4 0 100
예제 출력 1
345 2
rotS 2 1
negR 2
예제 입력 2
3 3
8 -2 7
1 0 -3
-4 -8 3
예제 출력 2
34 4
rotR 1 1
rotS 3 1
negR 2
negR 3
예제 입력 3
예제 출력 3
이 문제는 현재 제출할 수 없습니다.
이 현상이 잘못되었다고 생각될 경우 관리자한테 문의주세요.