#P4194. 矩阵
矩阵
Description
Given an integer matrix , find a matrix such that , and minimize the following value.
$$\max\begin{cases}\displaystyle\max_{1\le j\le m}\left\{\left|\sum_{i=1}^n\left(A_{i,j}-B_{i,j}\right)\right|\right\}\\\displaystyle\max_{1\le i\le n}\left\{\left|\sum_{j=1}^m\left(A_{i,j}-B_{i,j}\right)\right|\right\}\end{cases}$$Input Format
The first line contains two integers and , the size of the matrix.
Each of the next lines contains integers, describing matrix .
The last line contains two integers and .
Output Format
Output one line with a single integer representing the answer.
2 2
0 1
2 1
0 1
1
Hint
Constraints: For 100% of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号