|
Seia |
Hello. Excuse me... |
|
Midori |
W-why... Why is this happening...? |
|
Seia |
...?? (W-what is going on? Something feels wrong...) |
|
Midori |
This can't be, it can't...! It definitely wasn't like this yesterday...?! |
|
Seia |
Are you all right...? Has something happened...? |
|
Momoi |
How could this happen...! The testers were clearing it just fine, even during the final test...!! |
|
Midori |
T-there's a huge fight going on outside. I'm not sure why, but... I think the people who played our game started fighting. |
|
Seia |
After playing the game... they suddenly started fighting? |
|
Midori |
I-I know it sounds strange, but it's true! We never meant for this to happen...! |
|
Seia |
(...First, I should calm everyone down.) |
[A few minutes later]
|
Midori |
Thank you... We almost lost the game we worked so hard to make... |
|
Momoi |
W-why did it turn out like this...? Everyone was so excited just yesterday...! |
|
Aris |
Seia has not been consumed by the power of rage! Perhaps Seia knows the answer! |
|
Momoi |
...!! Really? |
|
Midori |
Were you... all right?? |
|
Seia |
I can't explain in detail, but... |
|
|
First, I need to fill an grid with various types of blocks, leaving no empty cells. Then I repeat the following procedure until it can no longer be performed.
The goal is to fill the grid with blocks so that the number of repetitions of the procedure is as large as possible. I see... The difficulty could certainly frustrate a player, but it hardly seems enough to cause a riot. How strange. Shall we give it a try?
There are test cases. The first line contains .
Each of the following test cases consists of one line containing integers and , separated by a space.
For each test case, print the number of repetitions of the procedure on the first line.
Then print the configuration of the grid on the next lines.
On each line, print a string of length consisting of uppercase English letters. Equal letters represent blocks of the same type.
Seia
|
To help you, I first need to investigate. So, if you don't mind... may I take a copy of the game with me? |
...Well, I have the game now, but I hardly know where to begin. Shall we start by analyzing its rules?