Log inSign up
Problems / S57

Big number subtraction (chat) · SmolLM2 135M

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

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 lineExpected output
913204 - 487561425643

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 - Y arrives 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.
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. You have to pass all 16 cases to solve this.

Input
Expected output
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.

Prompt

SmolLM2 135M
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 135M first with the button below.
0 chars
To solve problems you need to log in.