Squares
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
You are tasked with filling each cell of an N x N square table with either a zero or a one. The goal is to ensure that every K x K sub-square within the table contains exactly S ones.
Input Format:
The first line of input consists of three integers: N, K, S (1 ≤ N ≤ 100, 1 ≤ K ≤ N, 0 ≤ S ≤ K^2
).
Output Format:
Print the completed table. Each number in a row should be separated by a space, and each row should be printed on a new line. If there are multiple valid solutions, you may output any one of them.
Examples
Input #1
Answer #1
Submissions 29
Acceptance rate 28%