Given an $n$ by $s$ matrix $P$ of positive real numbers and $T\geq n$, find (either a formula or an algorithm) the real symmetric $n$ by $n$ Z-matrix $A$ which maximizes $\min\limits_{1\leq i<j\leq n}|Q_i-Q_j|_2$ subject to $$ (1,1,\dots,1)A=(1,1,\dots,1),\quad tr(A)=T $$ where $Q_i$ is the $i$th row of $A^{-1}P$ and $|\cdot|_2$ is the Euclidean norm.
Remark: Any Z-matrix $A$ satisfying $(1,1,\dots,1)A=(1,1,\dots,1)$ is an M-matrix, so has positive inverse.