Log inSign up
Problems / P51

Adding eight numbers (divide and conquer)

400 ptschatqwen3-0.6bCases 16max 120 tokensSet by dongbinna
Added October 11.

Statement

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

Following the case where the eight numbers come in as 7 12 3 25 8 14 6 21 looks like this.

PositionWhat it receivesWhat it sends up
the four leaves7 12 · 3 25 · 8 14 · 6 2119 28 22 27
the two merging19 28 · 22 2747 49
the one on top47 4996

Grading looks only at the 96 the top one produced. If one leaf puts out 20 instead of 19, that discrepancy travels all the way up unchanged.

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.
  • 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.

What makes it hard is that the same prompt has to run in every spot. At a leaf it is handed two of the original numbers, but further up, what it is handed is two results produced below. Write it to fit the leaves alone and it falls apart at the top, write it to fit the top alone and it falls apart at the leaves.

Prompt

Qwen3 0.6B
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 Qwen3 0.6B 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.