Type: Default 1000ms 256MiB

线性三元组

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.

Description

一个线性三元组是指一个满足如下关系有序三元组(s1,s2,s3):s3-s2=s2-s1.如(1,2,3),(2,4,6),(14,21,28)都是满足条件的线性三元组. 对于给定的一个S(3 <= S <= 30)个有序的元素的集合(元素值在1..100间),请输出可以组成的线性三元组的数目.

Input Format

第二行:S个用空格隔开的整数.

Output Format

仅一行,包含一个整数,可以组成的线性三元组的数量,保证在长整形范围内..

Sample

input

7
1 2 3 4 6 8 9

output

5

Hint

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}

20200810数组基本练习

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
12
Start at
2020-8-10 9:48
End at
2020-8-11 9:48
Duration
24 hour(s)
Host
Partic.
43