Scaled Chessboard

Interview

Time limit1sMemory limit128 MB

Summary
Print a checkerboard of R by C cells where each cell is scaled to an A by B block of X or dot characters.
Level

Easy2 of 10

Topics
Simulation, Implementation
Solved
No attempts yet

Problem

You need to print a chessboard made of black and white cells.

The cell in the upper-left corner is black. Moving one cell horizontally or vertically changes the color, so the colors alternate across the board. A black cell is printed as X, and a white cell is printed as ..

The original board has R rows and C columns. Each original cell must be expanded to a block that is A characters tall and B characters wide. Given R, C, A, and B, print the expanded board.

Input

The first line contains two positive integers R and C (1 <= R, C <= 10).

The second line contains two positive integers A and B (1 <= A, B <= 10).

Output

Print the described board using exactly R * A lines, each containing exactly C * B characters.

Examples2

  1. Example 1

    Input
    2 4
    2 2
    
    Expected output
    XX..XX..
    XX..XX..
    ..XX..XX
    ..XX..XX
    
  2. Example 2

    Input
    5 5
    2 3
    
    Expected output
    XXX...XXX...XXX
    XXX...XXX...XXX
    ...XXX...XXX...
    ...XXX...XXX...
    XXX...XXX...XXX
    XXX...XXX...XXX
    ...XXX...XXX...
    ...XXX...XXX...
    XXX...XXX...XXX
    XXX...XXX...XXX