题目:
You're given a sequence s of N distinct integers.
Consider all the possible sums of three integers from the sequence at three different indicies.
For each obtainable sum output the number of different triples of indicies that generate it.
Constraints:
N <= 40000, |si| <= 20000
Input
The first line of input contains a single integer N.
Each of the next N lines contain an element of s.
Output
Print the solution for each possible sum in the following format:
sum_value : number_of_triples
Smaller sum values should be printed first.
Example
Input: 5 -1 2 3 0 5 Output: 1 : 1 2 : 1 4 : 2 5 : 1 6 : 1 7 : 2 8 : 1 10 : 1
说明:Σx^2要怎么处理,这里表示的意思是指数是ai的2倍,那么它的系数即x^2的个数,就是ai的个数,
Σx^3也是一样的,就是ai的三倍。