Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/matritsa-birlik-matritsa

Identity matrix

Easy 1000 ms 128 MB 21%
Share

A positive integer $n$ is given. Build and print the $n \times n$ identity matrix ($1$ on the main diagonal, $0$ everywhere else).

An identity matrix with ones on the main diagonal

Input

One positive integer $n$.

Output

$n$ lines with $n$ space-separated integers each.

Note

$1 \le n \le 200$

Examples

Input #1
3
Output #1
1 0 0
0 1 0
0 0 1
Input #2
1
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.