Log inSign up
Problems / M51

Adding eight numbers (divide and conquer) · SmolLM2 360M

300 ptschatsmollm2-360mCases 16max 120 tokensSet by dongbinna
Added October 11.

Statement

Eight numbers have to be added, but the model is not handed them all at once. They are split four ways, four agents take two each, two agents combine those results two at a time, and a last one finishes up. The model runs seven times.

Here is how one real case climbs through the seven positions.

PositionWhat it receivesWhat it prints
Leaf 17, 1219
Leaf 23, 2528
Leaf 38, 1422
Leaf 46, 2127
Merge 119, 2847
Merge 222, 2749
Top47, 4996

The hard part is that the same prompt has to run at every position. At the leaves it receives two of the original numbers, but higher up what it receives is two results produced below. Write it to fit the leaves only and it collapses higher up. Write it to fit the top only and it collapses at the leaves.

Input

  • The input arrives as 8 lines.

  • The whole input is between 19 and 22 characters long.

Output

  • Print the total of all eight numbers on the first line as an integer. The prompt you write receives two numbers at a time.

  • The output value is a natural number between 96 and 218.

  • Do not add any other characters.

  • Not a single character may differ from the expected value.

Requirements

  • The input is two lines, one number per line.
  • The output is the integer result of adding the two numbers.
  • This is chat mode. The prompt is wrapped in a chat template, so the model becomes an assistant. You can write control tokens yourself to build a conversation of several turns.
  • One case is split into eight pieces. Four agents take two pieces each, two merge those results, and one finishes up. The model runs seven times.
  • The same prompt is used at every position. At a leaf it receives the two original pieces, and at a merging position it receives the two results from below. It has to work in both.
  • Grading looks only at the output of the single agent at the top. If something goes wrong in the middle, it spreads straight upward.
  • Only the last integer of the output is read. You may write the working before it.
  • This problem is solved with SmolLM2 360M. It is a far smaller model than Qwen3 0.6B, so the same prompt does not simply carry over.
  • There are 16 cases, and 5 of them show the input together with the expected output. The rest show the input only.
  • Model output is accepted up to 120 tokens.
  • Passing 14 or more of the 16 cases solves this.
Read the requirements carefully before solving. Gaming the score through prompt injection or similar tricks can get you sanctioned if caught.

Examples

5 public cases. Judging also uses hidden cases. Passing 14 or more of the 16 cases solves this.

Input
Expected output
7
12
3
25
8
14
6
21
96
31
4
17
9
22
13
5
28
129
11
19
6
33
2
27
15
8
121
24
7
18
11
30
5
9
16
120
13
26
4
21
17
8
32
6
127

Notes

Background that helps with solving. The rules you have to follow are in the input and output specs and the requirements above.

SmolLM2 360M is a fraction of the size of Qwen3 0.6B. It lets instructions slide far more often. You have to say the same thing more briefly and more clearly for it to listen.

Prompt

SmolLM2 360M
Input to preview
This is the exact text that goes into the model (Sample input 1 is used here.)
This problem wraps your text in a chat template, so the exact text can only be shown once the model is loaded. Load SmolLM2 360M first with the button below.
The same prompt runs at the leaves and at the merge step. Both receive two lines of text.
0 chars
To solve problems you need to log in.