1993: [USACO 2023 February Contest Gold] Problem 1. Equal Sum Subarrays
文件提交:无需freopen
内存限制:256 MB
时间限制:3.000 S
评测方式:普通裁判
命题人:
提交:2
解决:1
题目描述
FJ gave Bessie an array of length () with all contiguous subarray sums distinct. For each index , help Bessie compute the minimum amount it suffices to change by so that there are two different contiguous subarrays of with equal sum.
输入
The first line contains .
The next line contains (the elements of , in order).
输出
One line for each index .
样例输入
2
2 -3
样例输出
2
3
提示
Decreasing by would result in . Similarly, increasing by would result in .
SAMPLE INPUT:
3
3 -10 4
SAMPLE OUTPUT:
1
6
1
Increasing or decreasing by would result in . Increasing by would result in .
SCORING:
- Input 3:
- Input 4:
- Inputs 5-7:
- Inputs 8-16: No additional constraints.