# Constraints on sum of rows and columns of matrix

Suppose $r_i$, $1 \le i \le n$, and $c_j$, $1 \le j \le m$, are nonnegative integers. When does there exist an $n \times m$ matrix in $\text{Mat}_{n \times m} (\mathbb{Z}^+)$, i.e. nonnegative entries, such that $r_i$ is the sum of the entries in its $i$th row and $c_j$ is the sum of the entries in its $j$th columns?

-
@user314: Why the algebra-precalculus tag? –  Mike Spivey Nov 16 '10 at 5:50

$$\sum_i r_i = \sum_j c_j$$