#A. 重复(repeat)

    Type: Default File IO: repeat 1000ms 256MiB

重复(repeat)

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

给定一个长度为 nn 的递增数组 aia_i。定义其差分数组 D(a)D(a) 是一个长度为 n1n-1 的数组,且 D(a)=sort({ai+1ai})D(a)=\operatorname{sort}(\{a_{i+1}-a_i\})。其中 sort(S)\operatorname{sort}(S) 表示对 SS 进行排序之后的序列。

D(D(D(a)))1D(D(\dots D(a)))_1n1n-1DD)。

输入格式

第一行一个正整数 TT 表示测试点数目。

每个测试组,第一行一个正整数 nn

接下来 nn 个正整数表示 a1,a2,,ana_1,a_2,\dots,a_n

输出格式

对每个测试点,输出一行一个自然数表示答案。

样例

【样例输入】

5
3
1 10 100
4
4 8 9 13
5
0 0 0 8 13
6
2 4 8 16 32 64
7
0 0 0 0 0 0 0

【样例输出】

81
3
1
2
0

数据范围

对所有数据 1T201\leq T\leq 200a1a2an1090\leq a_1\leq a_2\leq\dots\leq a_n\leq 10^9

测试点编号 1n1\leq n\leq 特殊性质
11 10001000 ai1a_i\leq 1
22
33 2×1052\times 10^5 ai1a_i\leq 1
44

搬题人马没了\color{white}{搬题人马没了}

NOIP 模拟赛(十一)

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2024-11-20 7:45
End at
2024-11-20 12:15
Duration
4.5 hour(s)
Host
Partic.
17