# Determine whether there is a valid rounding in a table of numbers

I was told this question would be better suited here:

Suppose you have a table such as:

$\begin{array}{ccc} 11.998 & 9.083 & 2.919 &|& 24\\ 12.983 & 10.872 & 3.145 &|& 27\\ 1.019 & 2.045 & 0.936 &|& 4\\ 26&22&7&|&55 \end{array}$

Where the rows add up to the numbers on the right and the columns add up to the numbers on the bottom. How can we determine whether there is a valid arrangement of each number using ceiling and floor so that the sum of the rows and columns stays the same? For example, this has a valid arrangement because we can do:

$\begin{array}{ccc} 11 &10 & 3 &|& 24\\ 13 & 10 & 4 &|& 27\\ 2& 2 & 0 &|& 4\\ 26&22&7&|&55 \end{array}$

I'm supposed to use a network flow computation to solve the problem, but I can't figure out a way to arrange the nodes and edges so that I end up "discovering" whether the flow is valid. Do I have to create multiple graphs that each compute a separate flow (e.g. one for each column and one for each row)? I'm guessing that we have to end up with saturated edges at the end of our flow graph, but I'm not sure how to specify the graph so it solves the problem.