#B3888. Character Art Creation
Character Art Creation
Character Art Creation
In order to inspire students, the elementary IT class at Luogu Primary School teaches them to use drawing software, allowing them to create art freely on the computer. In this problem, you are tasked with generating a character art piece consisting of (n) rows, following these rules:
1. The (i)-th row must contain exactly (i^2) non-space characters.
2. The first non-space character of the (i)-th row is the (i)-th uppercase English letter. Each subsequent non-space character is filled with the next letter in alphabetical order (with the letter after (Z) being (A)).
3. For each non-space character to be filled, find the smallest column index (starting from 1) such that the sum of the column index and the ASCII code of the character is a prime number. If the condition is not met at a column, fill that column with a space and check the next column.
Print the completed character art.
inputFormat
A single integer (n) representing the number of rows.
outputFormat
Print (n) lines representing the character art. Each line may contain spaces.
sample
1
A