#P11007. 『STA - R7』Odtlcsu
『STA - R7』Odtlcsu
Background

Problem Description
Given integers , construct an integer sequence of length at most such that its sum is and its sum of squares is . It is guaranteed that a solution exists.
Input Format
One line with two integers .
Output Format
The first line contains a non-negative integer , indicating the length of the sequence you construct. It must satisfy .
The second line contains integers, representing the sequence you constructed. If there are multiple solutions, output any one. All elements in the output sequence must be integers with absolute value at most .
100 5000
2
50 50
0 5000
2
50 -50
Hint
This problem uses bundled tests.
Constraints:
- Subtask 1 (10pts): .
- Subtask 2 (40pts): .
- Subtask 3 (50pts): No special constraints.
For all testdata, , and a solution is guaranteed to exist.
Translated by ChatGPT 5