Addition (chat)
Statement
This is the same task as Addition (raw). The only difference is that this one is chat mode.
A string of the form X + Y comes in, and you have to print only the sum.
| Input | Expected output |
|---|---|
| 3 + 3 | 6 |
Input
A string of the form
X + Yarrives as the input.The input arrives as one line.
X is a natural number between 3 and 60.
Y is a natural number between 2 and 45.
There is one space between each number and the operator.
Output
Print the sum as an integer on the first line.
The output value is a natural number between 6 and 80.
Do not add any other characters.
Not a single character may differ from the expected value.
Requirements
- The input is a string of the form
X + Y. - The output is one integer, the sum of the two numbers. Do not attach any other characters.
- 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.
- The output must match the expected value down to the last character. Only leading and trailing whitespace is ignored.
- 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 8 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.
3 + 3
6
7 + 9
16
12 + 25
37
40 + 2
42
8 + 8
16
Notes
Background that helps with solving. The rules you have to follow are in the input and output specs and the requirements above.
Wrapping the prompt in the chat template turns the model from a machine that strings the next characters together into an assistant that follows instructions. An assistant wants to be helpful and attach an explanation. Even while giving the same answer, it leans toward writing 정답은 6입니다.
Solve the raw side first, then come back and see how the same prompt breaks here.