Arya and Sword Master

0

0 votes
Easy
Problem

We all know that Arya stark is very sharp and smart. Her father had decided that she should learn the sword fighting. He had found a swords master for her. He was ready to train her but on condition. He wanted to know how smart is Arya. So he gave her one question . The question goes like this---You have been given a set of integers both positive and negative. You have to find the six numbers denoting u,v,w,x,y,z such that it satisfies the below equation:-

Equation :- ((u+v)*y)/x-w=z where x!=0

Help Arya find the solution to this question.

Input: The first line contains N (Size of set) and the next N lines contains the elements of set.

Output: The total number of such possible values of(u,v,w,x,y,z) from the set

Constraints:

All the integers are between -4000 to 4000

N (size of the set) is 1<=N<=100

All the elements of the set are distinct.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In the sample test case , the given set is {2,3} which contains two elements and both the elements are distinct. one of the possible solution is (u,v,w,x,y,z) is (3,3,3,3,3,3).

((3+3)*3)/3 - 3 = 3. Like wise total 14 possible solutions exists for the given set.

Editor Image

?