각 열에 토큰을 하나씩 놓아 행별 토큰 수의 차이를 최소로 만들고, 그다음 토큰이 놓인 칸의 최댓값을 최소로 만든다.
Consider the following game. You have an integer matrix of size N×MN \times MN×M. Your task is to put MMM tokens at some cells of the matrix such as:
The first line of input contains two integers NNN and MMM (1≤N,M≤1101 \le N, M \le 1101≤N,M≤110). Then matrix a_ia\_ia_i comes: NNN lines, each containing MMM integers a_i,ja\_{i,j}a_i,j (1≤a_i,j≤1091 \le a\_{i,j} \le 10^91≤a_i,j≤109).
Print two integers which describe the placement you found: the minimum possible value of D_rD\_rD_r and the minimum value in a matrix cell with a token.