Argus was accused of watching Io, which is anything but a standard cow. Io is a serious pioneer, and she strays rather oftentimes, making Argus' life distressing. So the cowherd chose to build an encased field for Io. There are n trees developing along the waterway, where Argus tends Io. For this issue, the waterway can be considered to be the OX hub of the Cartesian arrange framework, and the n trees as focuses with the y-
Correct answer will be upvoted else Multiple Downvoted. Computer science.
Argus was accused of watching Io, which is anything but a standard cow. Io is a serious pioneer, and she strays rather oftentimes, making Argus' life distressing. So the cowherd chose to build an encased field for Io.
There are n trees developing along the waterway, where Argus tends Io. For this issue, the waterway can be considered to be the OX hub of the Cartesian arrange framework, and the n trees as focuses with the y-organize equivalent 0. There is likewise another tree filling in the point (0,1).
Argus will tie a rope around three of the trees, making a three-sided field. Its precise shape doesn't make any difference to Io, yet its region is vital to her. There might be numerous ways for Argus to orchestrate the fence, however just the ones which bring about various spaces of the field are intriguing for Io. Work out the number of various regions that her field might have. Note that the field should have nonzero region.
Input
The input comprises of various experiments. The primary line contains an integer t (1≤t≤100) — the number of experiments. Then, at that point, t experiments follow, every one is depicted in two lines.
In the principal line of each experiment there is a solitary integer n (1≤n≤50) indicating the number of trees developing along the waterway. Next line contains n unmistakable integers x1<x2<… <xn−1<xn (1≤xi≤50), the x-directions of trees developing along the stream.
Output
In a solitary line output an integer, the number of various nonzero regions that triangles with trees as vertices might have
Step by step
Solved in 4 steps with 1 images