#K54197. Generate LED Board
Generate LED Board
Generate LED Board
This problem requires you to generate a board of size \( m \times n \) filled with LEDs such that no two LEDs are adjacent. An LED is represented by the character 'O' and an empty cell by '.'.
You must maximize the number of LEDs placed on the board. Formally, the maximum number of LEDs that can be placed is \( \lceil \frac{m \times n}{2} \rceil \). The board should follow a checkerboard pattern, and the pattern generated by your solution will be unique according to the rule \( (i+j) \mod 2 = 0 \), where \( i \) and \( j \) are the 0-indexed row and column indices respectively.
Output the maximum number of LEDs on the first line and then each subsequent line should output one row of the board configuration.
inputFormat
The input consists of a single line containing two integers ( m ) and ( n ) separated by a space, where ( m ) is the number of rows and ( n ) is the number of columns of the board.
outputFormat
The first line of output should be the maximum number of LEDs that can be placed. The next ( m ) lines should each contain a string representing a row of the board configuration.## sample
3 3
5
O.O
.O.
O.O
</p>