title: Print the elements of the matrix with each row in a new line and elements of each row are separated by a space
body: <blockquote>
    <p>You are provided with the number of rows (R) and columns (C). Your task is to generate the matrix having R rows and C columns such that all the numbers are in increasing order starting from 1 in row wise manner.</p>
    
    <p>Input Format:
    The first line contain two numbers R and C separated by a space.</p>
    
    <p>Output Format:
    Print the elements of the matrix with each row in a new line and elements of each row are separated by a space.</p>
    
    <p>NOTE: There should not be any space after the last element of each row and no new line after the last row.</p>
    
    <p>Example:</p>
    
    <p>Input:</p>
  </blockquote>
  
  <pre><code>3 3
  </code></pre>
  
  <blockquote>
    <p>Output:</p>
  </blockquote>
  
  <pre><code>1 2 3
  4 5 6
  7 8 9
  </code></pre>
  
  <blockquote>
    <p>I have tried the following code. It runs on the online compiler. But shows an error in some compilers , \n in the output. I want to remove this error</p>
  </blockquote>
  
  <pre><code>x=[]
  a=[int(n) for n in input().split()]
  #print(*a)
  
  for i in range(a[0]):
      x.append(list(map(int, input().rstrip().split())))
  
  for i in range(a[0]):
      for j in range(a[1]): 
          print(x[i][j], end = " ")
      print()
  </code></pre>
  
  <p>Desired output on new lines</p>
  
  <pre><code>1 2 3
  4 5 6
  </code></pre>
  
  <p>Actual output </p>
  
  <pre><code>1 2 3\n
  4 5 6
  </code></pre>