Problem Y
Tomography
Binary tomography deals with the problem of reconstructing
binary images from a small number of projections. One of its
most basic problems is to construct a binary (
Input
The first line of input contains two numbers
Output
Output “Yes” if there exists an
Otherwise output “No”.
Example
The figure below illustrates a matrix with the row and column sums of sample input 1.
![\includegraphics[width=4cm]{sample1.png}](/problems/tomography/file/statement/en/img-0001.png)
Sample Input 1 | Sample Output 1 |
---|---|
3 4 2 3 2 1 1 3 2 |
Yes |
Sample Input 2 | Sample Output 2 |
---|---|
3 3 0 0 3 0 0 3 |
No |