title: C: How to take an input as unknown sized matrix
body: <p>Question:
  Given a matrix A, compute the sum of maximal elements row-wise (find a maximum element of each row and take their sum) and column-wise independently and return those values.</p>
  <p>In which input is going to be :
  First-line contains n, m number of rows and columns of input matrix.
  Next n lines contains m integers.</p>
  <p>Some examples:</p>
  <p>Input1:</p>
  <pre><code>3 3
  4 3 2 
  3 7 7 
  2 6 0
  </code></pre>
  <p>Output1:</p>
  <pre><code>17 18
  </code></pre>
  <p>Input2:</p>
  <pre><code>3 4
  1 2 3 4
  5 6 7 8
  9 10 11 12
  </code></pre>
  <p>Output2:</p>
  <pre><code>24 42
  </code></pre>
  <p>I can't tell how I am supposed to take the matrix input using scanf. Please help.</p>