Checklist VsOSh AI 2026 Regional Stage, Tour 1 (mathematics) · E task
The Line Rotates
Russian title: Прямая крутится
For three two-coloured rectangles, find the best accuracy (by area) of a line through the centre used as a classifier.
The task
A rectangle is partly white and partly black. A classifier draws a line L through the centre of the rectangle and predicts black on one side and white on the other; its quality is the fraction of the area where the predicted colour is correct (for the 2 × 2 example square this fraction is 0.75).
Over all lines through the centre, find the largest possible correctly predicted fraction for each of three given pictures.
Abridged and translated by SOTA from the official Russian materials. The official statement has the exact rules, and it wins wherever this summary differs.
In English
This task was published in Russian. SOTA translated its 3 files into English on 16 September 2026. Only the words changed in the notebooks: markdown, code comments, messages and printed output. The code, file names and paths are the original's, so a translated notebook runs with the original data.
- Task statement Russian original of Task statement
- Full paper (all tasks of the tour) Russian original of Full paper (all tasks of the tour)
- Official editorial (all tasks of the tour) Russian original of Official editorial (all tasks of the tour)
Read the task statement in English
The Line Rotates
English translation by SOTA – AI Community of the Russian original. Organisers who would like this translation removed can email [email protected].
All-Russian School Olympiad in Informatics 2025–2026, Regional Stage, Grades 9–11
“Artificial Intelligence” profile, Tour 1, 17 January 2026
Task E
Points for the task: 50
Answer submission format: entering the answer
Number of attempts: 10
Submission that counts: the last one
Statement
Imagine that we have a rectangle coloured in two colours: part of its area is white and part is black. We need to classify the points inside the rectangle by colour.
We use a very simple classifier: we draw a line through the centre of the rectangle. Everything that lies on one side of this line is considered black, and everything on the other side is considered white.
Now let us see how well such a line can “guess” the labelling. For any chosen line , one can compute the fraction of the area where the predicted colour coincides with the true one.

Captions under the figure: left, “True labels”; right, “Predicted labels”.
Consider the example of a square. It is easy to see that the fraction of correctly predicted area is 0.75.
Among all lines passing through the centre of the rectangle, what is the largest value that the fraction of correctly predicted area can take? Compute the answers for each of the three pictures below.



Translator's note: the four figures above are the copies published with the official editorial; they are the same images as in the original statement. In each picture the red dot marks the centre of the rectangle. Cell by cell, the three pictures are as follows (# = black, . = white, top row first):
Picture 1 (12 × 5):
####.##.####
#..#.##.#...
####.##.#...
#..#.##.#...
#..#....####
Picture 2 (13 × 5):
#...#...#..##
#...#...##.##
#...#...#.#.#
#..##...#...#
###.###.#...#
Picture 3 (9 × 5):
###..#...
#.##.#...
#..#.#...
#..#.#...
####.###.
Output format
Write the answers for the three pictures, separated by spaces. Round the answers to 6 decimal places, using a point as the decimal separator.
Scoring
All three answers match: 50 points.
Two answers match: 25 points.
Test results are not available during the tour.
Translated by SOTA. The Russian original is the official version and wins wherever the two differ. The figures are embedded from the official editorial, which publishes the same images; a translator's note transcribes the three grids cell by cell. If you organise this olympiad and would like the translation removed, email [email protected] and we will take it down.
At a glance
- You get
- The three coloured rectangles are given as figures.
- You submit
- Three numbers separated by spaces, each rounded to 6 decimal places.
- Scoring
- Answer entry; 50 points if all three answers match, 25 if two match; 10 attempts, the last one counts; results hidden during the tour.
- Rules
- Python may be used, or the problem may be solved purely mathematically.
- Format
- Regional stage, Tour 1, 17 January 2026; grades 9–11; individual; 300-minute tour (Moscow procedure); answers entered in Yandex Contest.