SP8323 TRIEQUAL - Triangle equality

Description

Consider three distinct points A,B,C on a plane. The sum of straight line distances from A to B and B to C is always greater than or equal to the straight line distance from A to C. Equality holds only when ABC is a degenerate triangle. This is the famous **triangle inequality** In this case, distance between points is measured by the Euclidean metric. ie, the distance between points (x $ _{1} $ ,y $ _{1} $ ) and (x $ _{2} $ ,y $ _{2} $ ) is given by sqrt((x $ _{1} $ -x $ _{2} $ ) $ ^{2} $ +(y $ _{1} $ -y $ _{2} $ ) $ ^{2} $ ). However, this is not the only metric possible. Another common metric used is the **Manhattan metric** where the distance between the pair of points is given by |x $ _{1} $ -x $ _{2} $ |+|y $ _{1} $ -y $ _{2} $ | You are given N distinct points on a plane where distances are measured using the Manhattan metric. Find the number of ordered triplets of distinct points (A,B,C) such that the sum of distances from A to B and B to C is equal to the distance from A to C.

Input Format

The first line of input contains an integer T (

Output Format

Output T lines, each containing the number of ordered triplets of distinct points in every test case with the given property