<aside> <img src="/icons/chat_blue.svg" alt="/icons/chat_blue.svg" width="40px" />

For feedback or questions, please leave a comment on the Codeforces blog

</aside>

Hi! Since I couldn’t find an official one, I decided to post a full step-by-step editorial for Balkan OI 2025 Tiling Madness - one of my favorite problems from last year’s OIs.


Understanding the problem

First of all, let’s understand what the problem asks. It defines a $2N$-mino as a connected shape consisting of $2N$ squares. A $2N$-mino is valid if we can place $N$ copies of it so that they don’t overlap and there is a $N \times N$ square completely covered by them. We have to find as many unique valid $2N$-minoes as possible.

When we check the input files, we notice there is only one testcase (apart from the example), where $N=7$. So, we need to find as many valid $14$-minoes.

Scoring

Instead of having subtasks, the number of points we get depends on how many different solutions we find. In the scoring section we can find details on how many points we get depending on the number of solutions.


Output-only problems

This problem is output-only, which means that instead of submitting our code, we have to submit a text file containing the output. In the problem attachments we’ll find text files containing the input for each testcase.

The only technical difficulty of output-only problems is reading from and printing to a file. This is really easy to do in C++, by writing these two lines in the beginning of main():

ifstream cin("in.txt");
ofstream cout("out.txt");

Now we can use cin and cout like normal, except they will use in.txt for input and out.txt for output, instead of the terminal.

Output only problems are usually constructive. Since they have started to frequently appear in olympiads, including IOI, learning how to solve an output only problem is really important.

What’s the difference from batch problems?

Why would a problem be output-only instead of batch? After all, every output-only problem could’ve been a batch problem. There are three main differences:

  1. We can manually solve the first test cases - ****Since we have access to the input of all the test cases, we can solve them on paper and write the answers in the output files on our own. This can get us a few easy points, help us understand the input and output format and also give us some ideas for a better solution.
  2. There is no time limit - ****Although most brute force solutions will take too long even without a time limit, we can write some slower solutions without worrying.
  3. We have access to the output files - ****This means that we can make small changes and check that our answers are valid before submitting, and also makes debugging easier.