// editor5
#include<stdio.h>
int main()
{
    int n, m, num;
    printf("Enter thr number of rows (n): ");
    if (scanf("%d", &n) !=1 || n <= 1 || n >= 10)
    {
    printf("Invalid input for n. constraints: 1 < n < 10.\n");
    return 1;
    }
    printf("Enter the number of columns (m): ");
    if (scanf("%d", &m) != 1)
    {
        printf("Invalid input for m.\n");
        return 1;
    }
    printf("Enter the binary number to fill the grid (0 or 1): ");
    if (scanf("%d", &num) != 1 || (num != 0 && num != 1))
    {
        printf("Invakid input: Input is not a binary number.\n");
        return 1;
    }
    printf("\nSample Output:\n");
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            printf("%d ", num);
        }
        printf("\n");
    }