#K45342. Generate Grid
Generate Grid
Generate Grid
This problem requires you to generate a grid of sequential integers starting from 1, based on the provided number of total elements (\( n \)), rows (\( r \)), and columns (\( c \)). The grid is filled row by row from left to right. If the available integers run out in the middle of a row, only the filled part of that row should be printed.
Note: The grid should be generated by filling each row with up to \( c \) numbers until either all \( n \) numbers are placed or \( r \) rows have been generated, whichever comes first.
inputFormat
The input is provided via standard input (stdin) as a single line containing three integers \( n \), \( r \), and \( c \) separated by spaces.
outputFormat
Output the grid to standard output (stdout). Each row of the grid should be printed on a new line with the numbers separated by a single space. There should be no extra spaces at the end of each line.
## sample10 3 4
1 2 3 4
5 6 7 8
9 10
</p>