for i in range(int(input())):
n=int(input())
a=list(map(int,input().split()))
if a==sorted(a):
print(0)
continue
if(a[-1]<0 or a[-1]<a[-2]):
print(-1)
continue
print(n-2)
for i in range(n-2):
print(i+1,n-1,n)
/***********************************************************************************************************************
<<<<<<<<<<<<<<<<<<<<<<♥♥♥♥♥♥صلي على النبي وتبسم ♥♥♥♥♥♥>>>>>>>>>>>>>>>>>>>
**********************************************************************************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <deque>
#include <queue>
#include <stack>
#include <utility>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <numeric>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define endl '\n'
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define all(c) (c).begin(), (c).end()
#define rall(c) c.rbegin(), c.rend()
#define Sort(c) sort(all(c))
#define Reverse(c) reverse(all(c))
#define cin(c) for(auto&i:c)cin>>i;
#define cout(c) for(auto&i:c)cout<<i<<' '
#define cinpair(c) for(auto&i:c)cin>>i.first>>i.second
#define coutpair(c) for(auto&i:c)cout<<i.first<<' '<<i.second<<'\n'
#define sz(v) v.size()
#define F first
#define S second
#define pb push_back
#define fixed(n) fixed << setprecision(n)
bool IsPowerOf2(int x) {
return (x && !(x & x - 1));
}
int computeXOR(int n) {
if (n % 4 == 0)return n;
if (n % 4 == 1)return 1;
if (n % 4 == 2)return n + 1;
else return 0;
}
int getFirstOneIdx(int n) {
return log2(n & -n);
}
int getBit(int num, int idx) {
return ((num >> idx) & 1) == 1;
}
int setBit1(int num, int idx) {
return num | (1 << idx);
}
int setBit0(int num, int idx) {
return num & ~(1 << idx); // 110100, idx = 3 --> 110100 & ~000100 = 110100 & 111011
}
int flipBit(int num, int idx) {
return num ^ (1 << idx);
}
int BinaryExponentiationREC(int a, int b) {
if (!b)
return 1;
int ret = BinaryExponentiationREC(a, b / 2);
return (b & 1 ? ret * ret * a : ret * ret);
}
ll BinaryExponentiation(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)res *= a;
a *= a;
b /= 2;
}
return res;
}
ll ModularExponentiation(ll a, ll b, ll m) {
ll res = 1;
while (b) {
if (b & 1)res = (res * a) % m;
a = (a * a) % m;
b /= 2;
}
return res;
}
ll gcd(ll a, ll b) //O( log(max(a,b)) )
{
//gcd (a,b)=gcd(b,a%b)
// if b=0 stop
while (b != 0) {
ll a2 = a;
a = b;
b = a2 % b;
}
return a;
}
ll lcm(ll a, ll b) {
//return ((a * b) / gcd(a, b));
return (a / gcd(a, b)) * b;
}
ll Modulo(ll a, ll b) {
return (((a % b) + b) % b);
}
void solve() {
int n; cin>>n;
vector<ll>v(n);
cin(v);
if (v[n-1]<v[n-2])
{
cout<<-1;
return;
}
if (v[n-1]>=0)
{
cout<<n-2<<endl;
for(int i=0;i<n-2;i++)cout<<i+1<<' '<<n-1<<' '<<n<<endl;
return;
}
for (int i=0;i<n-1;i++)
{
if (v[i]>v[i+1])
{
cout<<-1;
return;
}
}
cout<<0;
}
int main() {
FAST
ll testcases = 1;
cin >> testcases;
while (testcases--) {
solve();
cout << endl;
}
return 0;
}
1302. Deepest Leaves Sum | 1209. Remove All Adjacent Duplicates in String II |
994. Rotting Oranges | 983. Minimum Cost For Tickets |
973. K Closest Points to Origin | 969. Pancake Sorting |
967. Numbers With Same Consecutive Differences | 957. Prison Cells After N Days |
946. Validate Stack Sequences | 921. Minimum Add to Make Parentheses Valid |
881. Boats to Save People | 497. Random Point in Non-overlapping Rectangles |
528. Random Pick with Weight | 470. Implement Rand10() Using Rand7() |
866. Prime Palindrome | 1516A - Tit for Tat |
622. Design Circular Queue | 814. Binary Tree Pruning |
791. Custom Sort String | 787. Cheapest Flights Within K Stops |
779. K-th Symbol in Grammar | 701. Insert into a Binary Search Tree |
429. N-ary Tree Level Order Traversal | 739. Daily Temperatures |
647. Palindromic Substrings | 583. Delete Operation for Two Strings |
518. Coin Change 2 | 516. Longest Palindromic Subsequence |
468. Validate IP Address | 450. Delete Node in a BST |