Ordered Triplets

3.7

11 votes
Problem

You are given an array of size . You have to find out number of ordered triplet  such that  where  represents absolute value.

Input:

First Line contains representing size of array.

Next line contains space separated integers representing array .

Output:

Print the number of ordered triplets satisfying above conditioned modulo  as answer will be large.

Constraints:

 

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?