#abc280b. B - Inverse Prefix Sum
B - Inverse Prefix Sum
Score : points
问题陈述
给定一个整数 和一个长度为 的序列 。
找出一个长度为 的序列 ,使得对于所有 满足以下条件:
- 。
这样的序列 总是存在且唯一。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given an integer and a sequence of length .
Find a sequence of length that satisfies the following condition for all :
- .
Such a sequence always exists and is unique.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the elements of a sequence that satisfies all the conditions in order, separated by spaces.
Sample Input 1
3
3 4 8
Sample Output 1
3 1 4
The sequence in the output actually satisfies all the conditions:
- ;
- ;
- .
Sample Input 2
10
314159265 358979323 846264338 -327950288 419716939 -937510582 97494459 230781640 628620899 -862803482
Sample Output 2
314159265 44820058 487285015 -1174214626 747667227 -1357227521 1035005041 133287181 397839259 -1491424381
update @ 2024/3/10 11:45:58