#K64082. Prime Matrix Generation
Prime Matrix Generation
Prime Matrix Generation
Given an integer (N), generate a (N \times N) matrix filled with the first (N^2) prime numbers in ascending order arranged row-wise.
For example, when (N=3), the resulting matrix is:
2 3 5
7 11 13
17 19 23
Your task is to implement a program that reads the integer from standard input (stdin) and prints the matrix to standard output (stdout) with each row on a new line and each number separated by a single space.
inputFormat
A single integer (N) (where (1 \leq N \leq 100)) representing the dimension of the square matrix.
outputFormat
Print the generated (N \times N) matrix. Each row should be printed on a new line with the prime numbers separated by a single space.## sample
1
2
</p>