Majestic Pairs#12265

Majestic Pairs

1 second
256 megabytes
Easy

You're given an array of size .

A pair (1 \le i \le j \le n) is called majestic if it satisfies the following condition:

Find the number of majestic pairs.

Input

The first line consists of one integer (1 \le t \le 10^5) — the number of test cases.

The first line of each test case consists of a single integer (1 \le n \le 10^5) — the size of the array .

The second line of each test case consists of integers a_1 , a_2 , ... , a_n (0 \le a_i \le 10^5) — the elements of the array .

It's guaranteed that the sum of over all test cases does not exceed 10^5.

Output

The output consists of lines. Each line contains a single integer, the number of majestic pairs.

Examples

Example 1

Loading
Loading

Note

In the first test case. The two majestic pairs are and .

In the second test case. The two majestic pairs are and .

Scoring

  1. Subtask ( points) : \sum{n} \le 1000

  2. Subtask ( points) : no additional constraints.