Problem

Source: Iran TST 2013:TST 2,Day 1,Problem 1

Tags: function, linear algebra, matrix, combinatorics proposed, combinatorics



Nonnegative real numbers $p_{1},\ldots,p_{n}$ and $q_{1},\ldots,q_{n}$ are such that $p_{1}+\cdots+p_{n}=q_{1}+\cdots+q_{n}$ Among all the matrices with nonnegative entries having $p_i$ as sum of the $i$-th row's entries and $q_j$ as sum of the $j$-th column's entries, find the maximum sum of the entries on the main diagonal.