cho.sh
Notes
Loading...

Jump Jump Championship

Time limit

2s

Memory limit

128 MB

Problem

Huyeon is competing in the Jump Jump Championship. There are N jump platforms arranged from left to right, and each platform has exactly one trophy.

A contestant may start on any one platform, then may move only to platforms on its right. Trophies can be collected under these rules.

  1. The trophy on the first platform visited can be collected immediately.
  2. To collect the trophy on the next platform, the previously collected trophy must fit inside the new one. In other words, the new trophy must be larger than the previous trophy.
  3. The contestant cannot move to another platform without collecting that platform's trophy.

For example, if the trophy sizes from left to right are 3 2 4 2 5, Huyeon can visit platforms 1, 3, and 5 to collect trophies of sizes 3 4 5. Visiting platforms 2, 3, and 5 to collect 2 4 5 is also possible.

Find the maximum number of trophies Huyeon can collect, and output one possible route of platform numbers that achieves it.

Input

The first line contains the number of test cases T.

For each test case, the first line contains the number of platforms N. The next line contains N integers, the trophy sizes on the platforms from left to right.

1 ≤ N ≤ 10,000. Each trophy size is a natural number between 1 and 1,000,000, inclusive. Multiple trophies may have the same size.

Output

For each test case, print two lines.

On the first line, print the maximum number of trophies that can be collected. On the second line, print the platform numbers of one route that achieves that count, in visiting order.

If several routes are possible, output any one of them.