Big number subtraction (chat) · SmolLM2 135M
Statement
Two six-digit numbers are subtracted. In chat mode there is no limit on the number of lines, so there is plenty of room for a scratchpad. That lets you have it write the working out at length.
| Input line | Expected output |
|---|---|
| 913204 - 487561 | 425643 |
The catch is that lastInt looks at the last integer, so if any words with numbers in them come after the working, those are read as the answer. Make it write at length, but make it end on a number.
Input
A string of the form
X - Yarrives as the input.The input arrives as one line.
X is a natural number between 466820 and 977561.
Y is a natural number between 123457 and 764918.
There is one space between each number and the operator.
Output
Print the result of the subtraction on the first line as an integer.
The output value is a natural number between 85085 and 586953.
Do not add any other characters.
Not a single character may differ from the expected value.
Requirements
- The input has the form
A - B, six-digits each. - The output is the difference as an integer.
- 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.
- Only the last integer of the output is read. You may write the working before it.
- This problem is solved with SmolLM2 135M. 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 16 tokens.
- You have to pass all 16 cases to solve this.
Examples
5 public cases. Judging also uses hidden cases. You have to pass all 16 cases to solve this.
913204 - 487561
425643
700000 - 123457
576543
845930 - 269481
576449
512037 - 398152
113885
960418 - 574839
385579
Notes
Background that helps with solving. The rules you have to follow are in the input and output specs and the requirements above.
SmolLM2 135M 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.