solution
stringlengths 11
983k
| difficulty
int64 0
21
| language
stringclasses 2
values |
---|---|---|
t=int(input())
for i in range(t):
n=int(input())
arr=list(map(int,input().split()))
if arr[0]+arr[1]<=arr[-1]:
print(1,2,len(arr))
else:
print(-1) | 7 | PYTHON3 |
import sys
import math
import time
from functools import lru_cache
from collections import Counter
import heapq
#@lru_cache(maxsize=None) #for optimizing the execution time of callable objects/functions(placed above callable functions)
def pw(a,b,m):
a%=m
ans=1
if a==0:return 0
while(b>0):
if(b&1):
ans=(ans*a)%m
b=b//2
a=(a*a)%m
return ans
try:
for _ in range(int(input())):
n=int(input())
arr=[int(i) for i in input().split()]
ans=arr[0]+arr[1]
flg=0;pos=0
for i in range(2,n):
if ans<=arr[i]:
flg=1
pos=i
break
if flg==0:
print(-1)
else:
print(1,2,pos+1)
except EOFError as e:
print(e)
| 7 | PYTHON3 |
import datetime
def check(ar):
for i in range(len(ar)-2):
s=ar[i]+ar[i+1]
j=len(ar)-1
if(s<=ar[j]):
li=i+1,i+2,j+1
return list(li)
else:
return [-1]
if __name__=="__main__":
n=int(input())
res=[]
for _ in range(n):
q=int(input())
arr=list(map(int,input().split()))
res.append(arr)
for items in res:
result=check(items)
print(*result)
exit()
| 7 | PYTHON3 |
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
x = int(input())
n = list(map(int,input().split()))
if n[0] + n[1] <= n[-1]:
print(1,2,len(n))
else:
print(-1) | 7 | PYTHON3 |
t=int(input())
for _ in range(t):
n=int(input())
a=list(map(int,input().split()))
if a[0]+a[1]<=a[-1]:
print(1,2,(a.index(a[-1])+1))
else:
print(-1) | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
arr = [int(x) for x in input().split()]
arr.sort()
if arr[0]+arr[1]<=arr[len(arr)-1]:
print(1,2,len(arr))
else:
print(-1)
| 7 | PYTHON3 |
#------------------------------warmup----------------------------
# *******************************
# * AUTHOR: RAJDEEP GHOSH *
# * NICK : Rajdeep2k *
# * INSTITUTION: IIEST, SHIBPUR *
# *******************************
import os
import sys
from io import BytesIO, IOBase
import math
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
self.write = self.buffer.write if self.writable else None
def read(self):
while True:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
if not b:
break
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines = 0
return self.buffer.read()
def readline(self):
while self.newlines == 0:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
self.newlines = b.count(b"\n") + (not b)
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines -= 1
return self.buffer.readline()
def flush(self):
if self.writable:
os.write(self._fd, self.buffer.getvalue())
self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
def __init__(self, file):
self.buffer = FastIO(file)
self.flush = self.buffer.flush
self.writable = self.buffer.writable
self.write = lambda s: self.buffer.write(s.encode("ascii"))
self.read = lambda: self.buffer.read().decode("ascii")
self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
#-------------------game starts now---------------------------------------------------
for _ in range((int)(input())):
n=(int)(input())
l=list(map(int,input().split()))
# a,b=map(int,input().split())
l.sort()
if l[0]+l[1]<=l[-1]:
print(1,2,n,sep=' ')
else:
print('-1') | 7 | PYTHON3 |
for _ in range(int(input())):
length = int(input())
if length < 3:
print(-1); continue
sequence = [int(i) for i in input().split()]
min_side = sequence[0]; max_side = sequence[-1]
if sequence[1] <= max_side - min_side:
print(1, 2, length)
else:
print(-1) | 7 | PYTHON3 |
# non-degenerate triangle conditions:
# a+b>c
# a+c>b
# b+c>a
t = int(input())
for _ in range(t):
n = int(input())
a = [int(i) for i in input().split(" ")]
i = 0
j = 1
k = len(a) - 1
while j<k:
if a[i] + a[j] <= a[k]:
print(i+1, j+1, k+1)
break
i+=1
j+=1
if j>=k:
print(-1) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
input()
l = [int(i) for i in input().split()]
ok = False
if sum(l[:2]) > l[-1]:
# Se os menores dos lados podem combinar com o maior
# para formar um triΓ’ngulo "de verdade" (nΓ£o degenerado),
# entΓ£o Γ© impossΓvel formar triΓ’ngulo degenerado se se pode
# usar todos os nΒΊs disponΓveis
print(-1)
else:
# TriΓ’ngulo Γ© egenerado
print(1, 2, len(l)) | 7 | PYTHON3 |
for i in range(int(input())):
N=int(input())
side_array=list(map(int,input().split()))
for i in range(2,N):
if side_array[0]+side_array[1]<=side_array[i]:
flag=1
d=i
break
else:
flag=0
if flag==1:
print(1,2,d+1)
else:
print(-1) | 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
A = list(map(int,input().split()))
a = A[0]+A[1]
if(A[-1]>=a):
print(1,2,n)
else:
print("-1")
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void c_p_c() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
double pi = 3.141592653589;
void solve() {
long long n;
cin >> n;
long long a[n];
for (long long &i : a) cin >> i;
if (a[0] + a[1] <= a[n - 1]) {
cout << 1 << " " << 2 << " " << n << "\n";
return;
}
cout << -1 << "\n";
}
int32_t main() {
long long x;
cin >> x;
while (x--) solve();
return 0;
}
| 7 | CPP |
def answer(n,A):
if A[0]+A[1]>A[-1]:
return [-1]
else:
return [1,2,n]
t=int(input())
for i in range(t):
n=int(input())
arr=list(map(int,input().split()))
print(*answer(n,arr)) | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
l = list(map(int,input().split()))
a = 0
b = 1
c = 2
knt = 0
while c<n:
if l[a] + l[b] <= l[c]:
print(a+1,b+1,c+1)
knt = 1
break
c+=1
if knt == 0:
print("-1")
| 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[n-1]:
print("{} {} {}".format(1, 2, n))
continue
else:
print(-1) | 7 | PYTHON3 |
def main():
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().strip().split()))
if a[0] + a[1] <= a[-1]:
print("1 2", n)
else: print(-1)
if __name__ == "__main__": main() | 7 | PYTHON3 |
t = int(input())
while t > 0:
n = int(input())
arr = list(map(int , input().split()))
flag = True
if arr[0] + arr[1] > arr[-1]:
print(-1)
else:
print(1,2,n)
t -= 1 | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
for i in range(1, n - 1):
if a[n-1] >= a[0] + a[i]:
print(1, i+1, n)
break
else:
print(-1) | 7 | PYTHON3 |
from bisect import bisect_left
for _ in range(int(input())):
n = int(input())
a = [*map(int, input().split())]
a.sort()
ans = [-1]
for i in range(1, n):
j = bisect_left(a, a[i] + a[i - 1])
if j < n:
ans = (i, i + 1, j + 1)
print(*ans) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
i1, i2, i3 = a[0], a[1], a[-1]
if i1 + i2 <= i3 or i1 + i3 <= i2 or i3 + i2 <= i1:
print(1, 2, n)
# for i in range(n-2):
# i1, i2, i3 = a[i], a[i+1], a[i+2]
# if i1 + i2 <= i3 or i1 + i3 <= i2 or i3 + i2 <= i1:
# print(i+1, i+2, i+3)
# break
else:
print(-1)
| 7 | PYTHON3 |
from sys import stdin
input = stdin.buffer.readline
inf = 1000000001
for _ in range(int(input())):
n = int(input())
*a, = map(int, input().split())
a = sorted([(a[i], i + 1) for i in range(n)])
if a[-1][0] >= a[0][0] + a[1][0]:
print(*sorted([a[0][1], a[1][1], a[-1][1]]))
else:
print(-1)
| 7 | PYTHON3 |
t = int(input())
while t:
t += -1
n = int(input())
l = list(map(int, input().split()))
if l[0] + l[1] <= l[n - 1]: print(1, 2, n)
else: print(-1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
long long amax(long long a[], long long n) {
long long max = 0;
for (long long i = 0; i < n; i++) {
if (a[i] > max) max = a[i];
}
return max;
}
long long amin(long long a[], long long n) {
long long min = 1000000000;
for (long long i = 0; i < n; i++) {
if (a[i] < min) min = a[i];
}
return min;
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
return (a.first > b.first);
}
int main() {
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
long long a[n];
for (long long i = 0; i < n; i++) cin >> a[i];
sort(a, a + n);
long long a1 = a[n / 2];
long long b1 = a[(n / 2) - 1];
long long c = a[(n / 2) + 1];
if (a[0] + a[1] <= a[n - 1])
cout << 1 << " " << 2 << " " << n << endl;
else
cout << -1 << endl;
}
return 0;
}
| 7 | CPP |
for i in range(int(input())):
n=int(input())
a=list(map(int,input().split()))[:n]
print(*([1,2,n],[-1])[a[0]+a[1]>a[-1]])
| 7 | PYTHON3 |
N = int(input())
LIS = [0 for i in range (N)]
for j in range(N):
x = int(input())
listik = [int(i) for i in input().split()]
if ((listik[0] + listik[1]) <= listik[x-1]):
LIS[j] = [1,2,x]
else: LIS[j] = [-1]
for lis in LIS:
lis = [str(i) for i in lis]
print(' '.join(lis)) | 7 | PYTHON3 |
t=int(input())
for test in range(t):
n=int(input())
arr=[int(x) for x in input().split()]
if arr[0] +arr[1] <= arr[n-1]:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
rounds = int(input())
for _ in range(rounds):
n = int(input())
values = list(map(int, input().split()))
if values[0] + values[1] <= values[-1]:
print(1, 2, len(values))
else:
print(-1) | 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
if(a[0] + a[1] <= a[n - 1]):
print(1, 2, n)
else:
print(-1) | 7 | PYTHON3 |
import bisect
for t in range(int(input())):
n=int(input())
arr=list(map(int,input().split()))
for i in range(n-2):
first=arr[i]
second=arr[i+1]
maxim_no=first+second
if arr[-1]<maxim_no:
print(-1)
break
else:
print(i+1,i+2,n)
break | 7 | PYTHON3 |
def find(li, n):
for i in range(n - 2):
if li[i] + li[i + 1] <= li[n - 1]:
return i + 1, i + 2, n
return None
for j in range(int(input())):
n = int(input())
li = [int(x) for x in input().split()]
print(*find(li, n)) if find(li, n) != None else print(-1)
| 7 | PYTHON3 |
import sys
def inp():
inp = input().split()
if len(inp) == 1:
return int(inp[0])
else:
return (int(i) for i in inp)
def inpl():
inp = input().split()
for i in range (len(inp)):
inp[i]=int(inp[i])
return inp
# Problem 1
testcases = inp()
for testcase in range (testcases):
found=False
n=inp()
s=inpl()
# for i in range (n-2):
# if s[i]+s[i+1]<=s[i+2]:
# print(i+1,i+2,i+3)
# found=True
# break
# if not found:
# print(-1)
if s[0]+s[1]<=s[-1]:
print(1,2,n)
else:
print(-1)
# Problem 2
# testcases = inp()
#
# for testcase in range (testcases):
#
# Problem 3
# testcases = inp()
#
# for testcase in range (testcases):
#
# Problem 4
# testcases = inp()
#
# for testcase in range (testcases):
#
# Problem 5
# testcases = inp()
#
# for testcase in range (testcases):
#
| 7 | PYTHON3 |
a = int(input())
for i in range(a):
n = int(input())
a = list(map(int, input().split()))
res = []
i = 0
j = 1
k = 2
while k < len(a) and a[i] + a[j] > a[k]:
k += 1
if k == len(a):
print(-1)
else:
print(i + 1, j + 1, k + 1)
| 7 | PYTHON3 |
import sys
def main():
res = ''
input = sys.stdin.readline
print = sys.stdout.write
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[n - 1]:
sub_res = f'{1} {2} {n}\n'
else:
sub_res = '-1\n'
res += sub_res
print(res)
main() | 7 | PYTHON3 |
T = int(input())
for t in range(T):
n = int(input())
A = list(map(int,input().split(' ')))
if A[0]+A[1]<=A[-1]:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
import sys
import math
from math import *
from collections import Counter,defaultdict
from io import BytesIO, IOBase
from collections import deque
import bisect
def main():
n = int(input())
arr = list(map(int, input().split()))
if arr[0]+arr[1]>arr[-1]:
print(-1)
else:
print(1,2,n)
for i in range(int(input())):
main() | 7 | PYTHON3 |
cases=int(input())
for _ in range(cases):
n=int(input())
l=list(map(int,input().split()))
if l[0]+l[1]<=l[-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
return b == 0 ? a : gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
return (a * b) / gcd(a, b);
}
bool isprime(long long int x) {
for (long long int i = 2; i <= sqrt(x); i++) {
if (x % i == 0) return false;
}
return true;
}
long long int modpow(long long int x, long long int y) {
x %= 1000000007;
long long int res = 1;
while (y > 0) {
if (y & 1) res *= x % 1000000007;
y = y >> 1;
x = x * x % 1000000007;
}
return res % 1000000007;
}
long long int ncr(long long int n, long long int k) {
long long int res = 1;
if (k > n - k) k = n - k;
for (long long int i = 0; i < (long long int)k; i++) {
res *= (n - i);
res /= (i + 1);
}
return res;
}
long long int bintodec(long long int n) {
long long int decimal = 0, i = 0, rem;
while (n != 0) {
rem = n % 10;
n /= 10;
decimal += rem * pow(2, i);
++i;
}
return decimal;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long int i = 0, n, aa, t;
vector<long long int> a;
cin >> t;
while (t--) {
cin >> n;
for (long long int i = 0; i < (long long int)n; i++) {
cin >> aa;
a.push_back(aa);
}
i = 0;
bool f = false;
if ((a[0] + a[1]) <= a[a.size() - 1]) {
cout << i + 1 << " " << i + 2 << " " << n << '\n';
f = true;
}
if (f == false) cout << -1 << '\n';
a.clear();
}
return 0;
}
| 7 | CPP |
# Hey, there Stalker!!!
# This Code was written by:
# βββββββββββββββββββββ
# βββββββββ¦ββββββββββββ
# βββββββββββββ ββββββββ
# βββββββββββββ β¬βββ£ββββ
# βββββββββββββ β£βββ£ββββ
# βββββ£ββββββββββββ£ββββ
# βββββ©ββββ©ββββ£β βββ©ββββ
# βββββββββββββββββββββ
# βββββββββββββββββββββ
# βββββββββββββββββββββ
#from functools import reduce
#mod=int(1e9+7)
#import resource
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#import threading
#threading.stack_size(2**26)
"""fact=[1]
#for i in range(1,100001):
# fact.append((fact[-1]*i)%mod)
#ifact=[0]*100001
#ifact[100000]=pow(fact[100000],mod-2,mod)
#for i in range(100000,0,-1):
# ifact[i-1]=(i*ifact[i])%mod"""
#from collections import deque, defaultdict, Counter, OrderedDict
#from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
#from heapq import heappush, heappop, heapify, nlargest, nsmallest
# sys.setrecursionlimit(10**6)
from sys import stdin, stdout
import bisect #c++ upperbound
from bisect import bisect_left as bl #c++ lowerbound bl(array,element)
from bisect import bisect_right as br #c++ upperbound
import itertools
from collections import Counter
from math import sqrt
import collections
import math
import heapq
import re
def modinv(n,p):
return pow(n,p-2,p)
def cin():
return map(int,sin().split())
def ain(): #takes array as input
return list(map(int,sin().split()))
def sin():
return input()
def inin():
return int(input())
def Divisors(n) :
l = []
for i in range(1, int(math.sqrt(n) + 1)) :
if (n % i == 0) :
if (n // i == i) :
l.append(i)
else :
l.append(i)
l.append(n//i)
return l
def most_frequent(list):
return max(set(list), key = list.count)
def GCD(x,y):
while(y):
x, y = y, x % y
return x
def ncr(n,r,p): #To use this, Uncomment 19-25
t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p
return t
def Convert(string):
li = list(string.split(""))
return li
def SieveOfEratosthenes(n):
global prime
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * p, n+1, p):
prime[i] = False
p += 1
f=[]
for p in range(2, n):
if prime[p]:
f.append(p)
return f
prime=[]
q=[]
def dfs(n,d,v,c):
global q
v[n]=1
x=d[n]
q.append(n)
j=c
for i in x:
if i not in v:
f=dfs(i,d,v,c+1)
j=max(j,f)
# print(f)
return j
#Implement heapq
#grades = [110, 25, 38, 49, 20, 95, 33, 87, 80, 90]
#print(heapq.nlargest(3, grades)) #top 3 largest
#print(heapq.nsmallest(4, grades))
#Always make a variable of predefined function for ex- fn=len
#n,k=map(int,input().split())
"""*******************************************************"""
def main():
for _ in range(inin()):
n=inin()
a=ain()
flag=0
if a[0]+a[1]<=a[-1]:
print(1,2,n)
else:
print(-1)
"""*******************************************************"""
######## Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
from future_builtins import ascii, filter, hex, map, oct, zip
range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192
class FastIO(BytesIO):
newlines = 0
def __init__(self, file):
self._file = file
self._fd = file.fileno()
self.writable = "x" in file.mode or "w" in file.mode
self.write = super(FastIO, self).write if self.writable else None
def _fill(self):
s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
return s
def read(self):
while self._fill(): pass
return super(FastIO,self).read()
def readline(self):
while self.newlines == 0:
s = self._fill(); self.newlines = s.count(b"\n") + (not s)
self.newlines -= 1
return super(FastIO, self).readline()
def flush(self):
if self.writable:
os.write(self._fd, self.getvalue())
self.truncate(0), self.seek(0)
class IOWrapper(IOBase):
def __init__(self, file):
self.buffer = FastIO(file)
self.flush = self.buffer.flush
self.writable = self.buffer.writable
if py2:
self.write = self.buffer.write
self.read = self.buffer.read
self.readline = self.buffer.readline
else:
self.write = lambda s:self.buffer.write(s.encode('ascii'))
self.read = lambda:self.buffer.read().decode('ascii')
self.readline = lambda:self.buffer.readline().decode('ascii')
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
if __name__== "__main__":
main()
#threading.Thread(target=main).start()
| 7 | PYTHON3 |
def find_sides_indices(sorted_array):
if sorted_array[0] + sorted_array[1] <= sorted_array[-1]:
result = (0, 1, len(sorted_array) - 1)
else:
result = None
return result
def main():
t = int(input())
for i in range(t):
n = int(input())
a = tuple(map(int, input().split()))
indices = find_sides_indices(a)
if indices is None:
output = (-1,)
else:
output = sorted(i+1 for i in indices)
print(*output)
if __name__ == '__main__':
main()
| 7 | PYTHON3 |
import os
import sys
from io import BytesIO, IOBase
# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
self.write = self.buffer.write if self.writable else None
def read(self):
while True:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
if not b:
break
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines = 0
return self.buffer.read()
def readline(self):
while self.newlines == 0:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
self.newlines = b.count(b"\n") + (not b)
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines -= 1
return self.buffer.readline()
def flush(self):
if self.writable:
os.write(self._fd, self.buffer.getvalue())
self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
def __init__(self, file):
self.buffer = FastIO(file)
self.flush = self.buffer.flush
self.writable = self.buffer.writable
self.write = lambda s: self.buffer.write(s.encode("ascii"))
self.read = lambda: self.buffer.read().decode("ascii")
self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
# ------------------------------
def RL(): return map(int, sys.stdin.readline().rstrip().split())
def RLL(): return list(map(int, sys.stdin.readline().rstrip().split()))
def N(): return int(input())
def print_list(l):
print(' '.join(map(str,l)))
# import heapq as hq
# import bisect as bs
# from collections import deque as dq
from collections import defaultdict as dc
# from math import ceil,floor,sqrt
# from collections import Counter
for _ in range(N()):
n = N()
a = RLL()
if a[0]+a[1]<=a[-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
# import bisect
import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
from collections import deque
from functools import cmp_to_key
import math
# import heapq
def sin():
return input()
def ain():
return list(map(int, sin().split()))
def sain():
return input().split()
def iin():
return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007
def sieve(n):
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * p, n+1, p):
prime[i] = False
p += 1
s = set()
for p in range(2, n+1):
if prime[p]:
s.add(p)
return s
def readTree(n, m):
adj = [deque([]) for _ in range(n+1)]
for _ in range(m):
u,v = ain()
adj[u].append(v)
adj[v].append(u)
return adj
def main():
for _ in range(iin()):
n = iin()
l = ain()
ans = -1
flag = 0
if l[0]+l[1]<=l[-1]:
print(1,2,n)
flag=1
if flag == 0:
print(-1)
# Fast IO Template starts
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
self.write = self.buffer.write if self.writable else None
def read(self):
while True:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
if not b:
break
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines = 0
return self.buffer.read()
def readline(self):
while self.newlines == 0:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
self.newlines = b.count(b"\n") + (not b)
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines -= 1
return self.buffer.readline()
def flush(self):
if self.writable:
os.write(self._fd, self.buffer.getvalue())
self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
def __init__(self, file):
self.buffer = FastIO(file)
self.flush = self.buffer.flush
self.writable = self.buffer.writable
self.write = lambda s: self.buffer.write(s.encode("ascii"))
self.read = lambda: self.buffer.read().decode("ascii")
self.readline = lambda: self.buffer.readline().decode("ascii")
if os.getcwd() == 'D:\\code':
sys.stdin = open('input.txt', 'r')
sys.stdout = open('output.txt', 'w')
else:
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
# Fast IO Template ends
if __name__ == "__main__":
main() | 7 | PYTHON3 |
for i in range(int(input())):
x=int(input())
l=list(map(int,input().split()))
hi=l[-1]
lo=l[0]
ne=l[1]
if lo+ne>hi:
print(-1)
else:
print('1 2',end=' ')
print(len(l)) | 7 | PYTHON3 |
for _ in range(int(input())):
n, arr = int(input()), list(map(int, input().split()))
a,b = arr[0],arr[1]
s = a+b
f = 1
for i in range(2,n):
if s <= arr[i]:
f = 0
print(1,2,i+1)
break
if f:
print(-1)
| 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
if a[0]+a[1]<=a[-1]:
print("1 2",n)
else:
print("-1") | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long long_max = 9223372036854775807;
const long long inf = INT_MAX;
void pr(long long n) { cout << (n) << "\n"; }
void pr(string s) { cout << (s) << "\n"; }
void pr(string s, string s2) { cout << (s) << " " << (s2) << "\n"; }
void pr(pair<long long, long long> p) {
cout << (p).first << " " << (p).second << "\n";
};
void pr(long long a, long long b) { cout << (a) << " " << (b) << "\n"; }
void pr(long long a, long long b, long long c) {
cout << (a) << " " << (b) << " " << (c) << "\n";
}
void pr(long long a, long long b, long long c, long long d) {
cout << (a) << " " << (b) << " " << (c) << " " << (d) << "\n";
}
void pr(long long a, long long b, long long c, long long d, long long e) {
cout << (a) << " " << (b) << " " << (c) << " " << (d) << " " << (e) << "\n";
}
void pr(vector<long long> v) {
for (int i = 0; i < v.size(); ++i) cout << v[i] << " ";
cout << "\n";
}
void pr(vector<string> v) {
for (int i = 0; i < v.size(); ++i) cout << v[i] << " ";
cout << "\n";
}
void decimal(int);
long long min(long long, long long);
long long max(long long, long long);
long long multi(long long, long long);
long long add(long long, long long);
long long subtract(long long, long long);
long long modpower(long long, long long);
long long gcd(long long, long long);
long long modinv(long long, long long);
long long power(long long, long long);
long long divi(long long, long long);
void subsetsUtil(vector<long long>&, vector<vector<long long> >&,
vector<long long>&, long long);
vector<vector<long long> > subsets(vector<long long>&);
long long ncrmod(long long, long long, long long);
long long ncr(long long, long long);
long long npr(long long, long long);
long long nprmod(long long, long long);
vector<string> permutations(string);
void makeCombiUtil(vector<vector<long long> >&, vector<long long>&, long long,
long long, long long);
vector<vector<long long> > makeCombi(long long, long long);
void printSubSeqRec(string, long long, long long, string);
void printSubSeq(string);
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
if (a.first == b.first)
return a.second < b.second;
else
return a.first < b.first;
}
long long numdigit(long long n) {
long long cnt = 0;
while (n > 0) {
n /= 10;
cnt++;
}
return cnt;
}
pair<long double, long long> powerldpair(long double, long long);
bool isprime(long long n) {
if (n <= 1) return false;
for (long long i = 2; i <= sqrt(n); ++i)
if (n % i == 0) return false;
return true;
}
bool revcomp(long long a, long long b) { return a > b; }
vector<long long> decToBinary(long long n);
void solve() {
long long n;
cin >> n;
vector<long long> vec(n);
for (long long i = 0; i < (n); ++i) cin >> vec[i];
for (long long i = 0; i < (n - 2); ++i) {
long long th = vec[i] + vec[i + 1];
auto it = lower_bound(vec.begin() + i + 2, vec.end(), th);
if (it != vec.end()) {
pr(i + 1, i + 2, it - vec.begin() + 1);
return;
}
}
pr(-1);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}
long long min(long long x, long long y) {
if (x > y) return y;
return x;
}
long long max(long long x, long long y) {
if (x > y) return x;
return y;
}
long long add(long long x, long long y) {
return ((x % mod) + (y % mod) + mod) % mod;
}
long long multi(long long x, long long y) {
return ((x % mod) * (y % mod)) % mod;
}
long long subtract(long long x, long long y) {
return ((x % mod) - (y % mod) + mod) % mod;
}
long long divi(long long a, long long b) {
return (a % mod * modpower(b, mod - 2) % mod) % mod;
}
long long modpower(long long x, long long y) {
long long p = mod;
long long res = 1;
x = x % p;
while (y > 0) {
if (y & 1) res = (res * x) % p;
y = y >> 1;
x = (x * x) % p;
}
return res;
}
long long power(long long a, long long b) {
long long prod = 1;
while (b) {
if (b & 1) {
prod = (prod * a);
}
a = (a * a);
b >>= 1;
}
return prod;
}
pair<long double, long long> powerldpair(long double a, long long b) {
long double prod = 1;
long long powten = 0;
long long powtemp = 0;
while (b) {
if (b & 1) {
prod = (prod * a);
powten += powtemp;
while (prod >= 10) {
prod /= 10;
powten++;
}
}
a = (a * a);
powtemp *= 2;
while (a >= 10) {
a /= 10;
powtemp++;
}
b >>= 1;
}
return make_pair(prod, powten);
}
long long gcd(long long a, long long b) {
if (b > a) swap(a, b);
if (b == 0)
return a;
else
return gcd(b, a % b);
}
void subsetsUtil(vector<long long>& A, vector<vector<long long> >& res,
vector<long long>& subset, long long index) {
res.push_back(subset);
for (long long i = index; i < A.size(); i++) {
subset.push_back(A[i]);
subsetsUtil(A, res, subset, i + 1);
subset.pop_back();
}
return;
}
vector<vector<long long> > subsets(vector<long long>& A) {
vector<long long> subset;
vector<vector<long long> > res;
long long index = 0;
subsetsUtil(A, res, subset, index);
return res;
}
void decimal(int n) {
cout << fixed;
cout << setprecision(n);
}
vector<long long> decToBinary(long long n) {
long long binaryNum[65] = {0};
int i = 0;
while (n > 0) {
binaryNum[i] = n % 2;
n = n / 2;
i++;
}
vector<long long> bin(65, 0);
for (int j = i - 1; j >= 0; --j) {
bin[j] = binaryNum[j];
}
return bin;
}
long long modinv(long long n, long long p) { return modpower(n, p - 2); }
long long ncrmod(long long n, long long r, long long p) {
if (r == 0) return 1;
long long fac[n + 1];
fac[0] = 1;
for (long long i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;
return (fac[n] * modinv(fac[r], p) % p * modinv(fac[n - r], p) % p) % p;
}
long long ncr(long long n, long long k) {
long long res = 1;
if (k > n - k) k = n - k;
for (long long i = 0; i < k; ++i) {
res *= (n - i);
res /= (i + 1);
}
return res;
}
long long npr(long long n, long long k) {
long long P = 1;
for (long long i = 0; i < k; i++) P *= (n - i);
return P;
}
long long nprmod(long long n, long long k) {
long long P = 1;
for (long long i = 0; i < k; i++) P = multi(P, n - i);
return P % mod;
}
vector<string> permutations(string str) {
vector<string> vec;
sort(str.begin(), str.end());
do {
vec.push_back(str);
} while (next_permutation(str.begin(), str.end()));
return vec;
}
void makeCombiUtil(vector<vector<long long> >& ans, vector<long long>& tmp,
long long n, long long left, long long k) {
if (k == 0) {
ans.push_back(tmp);
return;
}
for (long long i = left; i <= n; ++i) {
tmp.push_back(i);
makeCombiUtil(ans, tmp, n, i + 1, k - 1);
tmp.pop_back();
}
}
vector<vector<long long> > makeCombi(long long n, long long k) {
vector<vector<long long> > ans;
vector<long long> tmp;
makeCombiUtil(ans, tmp, n, 1, k);
return ans;
}
void printSubSeqRec(string str, long long n, long long index = -1,
string curr = "") {
if (index == n) return;
cout << curr << "\n";
for (long long i = index + 1; i < n; i++) {
curr += str[i];
printSubSeqRec(str, n, i, curr);
curr = curr.erase(curr.size() - 1);
}
return;
}
void printSubSeq(string str) { printSubSeqRec(str, str.size()); }
| 7 | CPP |
from sys import stdin, gettrace
if gettrace():
inputi = input
else:
def input():
return next(stdin)[:-1]
def inputi():
return stdin.buffer.readline()
def solve():
n = int(inputi())
aa = [int(a) for a in inputi().split()]
if aa[0] + aa[1] <= aa[-1]:
print(1, 2, n)
else:
print(-1)
def main():
t = int(inputi())
for _ in range(t):
solve()
if __name__ == "__main__":
main()
| 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = [int(i) for i in input().split()]
if a[0]+a[1] > a[-1]:
print(-1)
else:
print(1, 2, n) | 7 | PYTHON3 |
t=int(input())
for g in range(t):
n=int(input())
l=list(map(int,input().split()))
if l[0]+l[1]<=l[-1]:
print(1,2,n)
else:
print("-1") | 7 | PYTHON3 |
t = int(input())
for i in range(t):
n = int(input())
arr = [int(k) for k in input().split()]
found = False
k = 2
for j in range(n-2):
while k < n and arr[j] + arr[j+1] > arr[k]:
k += 1
if k < n:
print(j+1, j+2, k+1)
found = True
break
if not found:
print(-1)
| 7 | PYTHON3 |
T = int(input())
for t in range(T):
n = int(input())
a = list(map(int, input().split()))
# for i in range(n):
# for j in range(i+1,n):
# for k in range(n-1,j):
# if a[i] + a[j] <= a[k]:
if a[0] + a[1] <= a[n-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
for vishal in range(int(input())):
n=int(input())
a=list(map(int,input().split()))
if a[0]+a[1]<=a[n-1]:
print("1 2",n)
else:
print("-1") | 7 | PYTHON3 |
for t in range(int(input())):
n = int(input())
l = list(map(int, input().split(" ")))
if l[0] + l[1] > l[-1]:
print(-1)
else:
print(1, 2, n) | 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
s=[int(i) for i in input().split()]
a=s[0]+s[1]
k=-1
for j in range(2,n):
if a<=s[j]:
k=j+1
break
if k!=-1:
print(1,2,k)
else:
print(-1)
| 7 | PYTHON3 |
T = int(input())
for case in range(T):
i = int(input())
#s = input()
#m,n = [int(x) for x in input().split()]
ls = [int(x) for x in input().split()]
if ls[0] + ls[1] <= ls[-1]:
print(1,2,len(ls))
else:
print(-1)
#print(r)
| 7 | PYTHON3 |
for _ in range(int(input())):
m = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] > a[-1]:
print(-1)
else:
print(1,2,m)
| 7 | PYTHON3 |
testcases = int(input())
for testcase in range(testcases):
n = int(input())
temparr = input()
temparr = temparr.split()
arr = []
for i in temparr:
arr.append(int(i))
l1 = 0
l2 = 1
l3 = n - 1
flag = 0
if arr[l1] + arr[l2] <= arr[l3]:
flag = 1
if flag == 0:
print(-1)
else:
print("1 2 " + str(n))
| 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
arr = list(map(int,input().split()))
for i in range(len(arr)-1,1,-1):
if arr[0] + arr[1] <= arr[i]:
print(1,2,arr.index(arr[i])+1)
break
else:
print(-1)
| 7 | PYTHON3 |
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
n = int(input())
a = [int(_) for _ in input().split()]
if a[0] + a[1] <= a[n-1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
t = int(input())
def satisfy(a, b, c):
return a + b > c and a + c > b and b + c > a
for case in range(t):
n = int(input())
a = list(map(int, input().split()))
done = False
if not satisfy(a[0], a[n - 2], a[n - 1]):
print(1, n - 1, n)
elif not satisfy(a[0], a[1], a[n - 1]):
print(1, 2, n)
else:
print(-1)
# for i in range(2, n):
# if (satisfy(a[i - 2], a[i - 1], a[i])):
# print(i - 1, i, i + 1)
# done = True
# break
# if not done:
# print(-1) | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
l = list(map(int, input().split()))
print(f'1 2 {n}' if l[0] + l[1] <= l[n - 1] else -1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
bool isPowerOfTwo(long long int x) { return x && (!(x & (x - 1))); }
void solve() {
long long int n;
cin >> n;
vector<pair<long long int, long long int>> vp;
for (long long int i = 0; i < n; ++i) {
long long int x;
cin >> x;
vp.push_back({x, i + 1});
}
sort(vp.begin(), vp.end());
if ((vp[0].first + vp[1].first) <= vp[n - 1].first) {
long long int arr[3] = {vp[0].second, vp[1].second, vp[n - 1].second};
sort(arr, arr + 3);
for (long long int i = 0; i <= 2; ++i) cout << arr[i] << " ";
} else
cout << "-1";
cout << "\n";
}
int32_t main() {
std::ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T = 1;
cin >> T;
while (T--) solve();
return 0;
}
| 7 | CPP |
t = int(input())
for _ in range(t):
n = int(input())
nums = list(map(int,input().split()))
if nums[0] + nums[1] <= nums[-1]:
print(*[1,2,n])
else:
print(-1)
| 7 | PYTHON3 |
import sys
input = sys.stdin.readline
for _ in range(int(input())):
n = int(input())
arr = list(map(int,input().split()))
a,b,c = arr[0], arr[1], arr[-1]
if a+b>c:
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
a=[int(x) for x in input().split()]
if a[0]+a[1]<=a[-1]:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
t = int(input())
while t:
n = int(input())
a = list(map(int,input().split(" ")))
k = n-1
flag=0
for i in range(n-2):
if a[i]+a[i+1] <= a[k]:
print(f'{i+1} {i+2} {k+1}')
flag=1
break
if flag==0:
print('-1')
t-=1 | 7 | PYTHON3 |
#!/usr/bin/env python
t = int(input())
for _ in range(t):
input()
lst = list(map(int, input().split()))
if lst[0] + lst[1] <= lst[-1]:
print(1, 2, len(lst))
else:
print(-1)
| 7 | PYTHON3 |
import sys
input = sys.stdin.readline
def inInt():
return int(input())
def inStr():
return input().strip("\n")
def inIList():
return (list(map(int, input().split())))
def inSList():
return (input().split())
####################################################
def solve(n, l):
if l[0] + l[1] <= l[n - 1]:
print("%s %s %s" % (1, 2, n))
else:
print(-1)
tests = inInt()
for t in range(tests):
n = inInt()
l = inIList()
solve(n, l) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long t, n, i;
cin >> t;
while (t--) {
cin >> n;
int a[n], x = 0;
for (i = 0; i < n; i++) cin >> a[i];
for (i = 2; i < n; i++) {
if ((a[0] + a[1]) <= a[i]) {
cout << "1"
<< " "
<< "2"
<< " " << i + 1 << endl;
x = 1;
break;
}
}
if (x == 0) cout << "-1" << endl;
}
return 0;
}
| 7 | CPP |
t = int(input())
for l in range(t):
n = int(input())
ar = list(map(int,input().strip().split()))
if ar[0]+ar[1]<=ar[-1]:
print(1,2,len(ar))
else:
print(-1) | 7 | PYTHON3 |
from sys import stdin,stdout
from math import gcd,sqrt,factorial
from collections import deque,defaultdict
input=stdin.readline
R=lambda:map(int,input().split())
I=lambda:int(input())
S=lambda:input().rstrip('\n')
L=lambda:list(R())
P=lambda x:stdout.write(x)
lcm=lambda x,y:(x*y)//gcd(x,y)
hg=lambda x,y:((y+x-1)//x)*x
pw=lambda x:0 if x==1 else 1+pw(x//2)
chk=lambda x:chk(x//2) if not x%2 else True if x==1 else False
sm=lambda x:(x**2+x)//2
N=10**9+7
for i in range(I()):
n=I()
a=L()
if sum(a[:2])>a[-1]:print(-1)
else:print(1,2,n) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
void think() {
long long n;
cin >> n;
vector<long long> a(n, 0);
for (long long i = 0; i < n; i++) {
cin >> a[i];
}
if (a[0] + a[1] <= a[n - 1]) {
cout << 1 << " " << 2 << " " << n << "\n";
} else {
cout << -1 << "\n";
}
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
;
long long testcase = 1;
cin >> testcase;
while (testcase--) {
think();
}
return 0;
}
| 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 1e5 + 10;
int t, n, a[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
cin >> t;
while (t--) {
cin >> n;
for (int i = 1; i <= n; ++i) cin >> a[i];
int x = a[1], y = a[2], z = a[n];
if (x + y <= z || y + z <= x || z + x <= y) {
cout << 1 << " " << 2 << " " << n << '\n';
} else
cout << "-1" << '\n';
}
}
| 7 | CPP |
from collections import defaultdict
for i in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
if l[0]+l[1]<=l[-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
t = int(input())
for _ in range(0,t):
n = int(input())
a = [int(i) for i in input().split()]
aa,bb,cc = a[0],a[1],a[-1]
if aa+bb > cc and aa+cc > bb and bb+cc > aa:
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
n_sets = int(input())
for i in range(n_sets):
n = int(input())
a = [int(x) for x in input().split()]
if a[0] + a[1] <= a[-1]:
print(1, 2, n)
else:
print(-1) | 7 | PYTHON3 |
b=int(input())
for _ in range (b):
a=int(input())
c=list(map(int,input().split()))
c.sort()
q=0
if c[0]+c[1]<=c[a-1]:
print (1,2,a)
else :
print(-1)
| 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = [int(x) for x in input().split()]
if a[0] + a[1] <= a[-1]:
print("1 2 " + str(n))
else:
print(-1) | 7 | PYTHON3 |
for i in range(int(input())):
a=int(input())
b=list(map(int,input().split()))
if b[0]+b[1]>b[a-1]:
print(-1)
else:
print(f'1 2 {a}') | 7 | PYTHON3 |
for item in range(int(input())):
input()
a = list(map(int,input().split()))
if a[0] + a[1] <= a[-1]:
print(1,2,len(a))
else:
print("-1")
| 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
arr = [int(num) for num in input().split(' ')]
if arr[0]+arr[1]>arr[-1]:
print(-1)
else:
print(1,end=' ')
print(2,end=' ')
print(n) | 7 | PYTHON3 |
T = int(input())
for t in range(T):
N = int(input())
lst = list(map(int, input().split()))
if((lst[0]+lst[1])>lst[N-1]):
print("-1")
else:
print("1 2 ",N) | 7 | PYTHON3 |
a=int(input())
for i in range(a):
b=int(input())
c=input().split()
if int(c[b-1])-(int(c[0])+int(c[1]))>=0:
print(1,2,b)
else:
print(-1) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n=int(input())
li=list(map(int,input().split()))
a=li[0]
b=li[1]
c=a+b
fg=0
d=0
for i in range(2,n):
if(c<=li[i]):
fg=1
d=i+1
break
if fg==0:
print(-1)
else:
print(1,2,d)
| 7 | PYTHON3 |
t = int(input())
for i in range(t):
n = int(input())
ai = list(map(int,input().split()))
if ai[-1] - ai[0] - ai[1] >= 0:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
def triangle(n,a):
b=a[0]+a[1]
for x in range(n):
if a[x]>=b:
print(1,2,x+1)
return
print(-1)
return
t=int(input())
array=[]
for i in range(t):
a=[]
a.append(int(input()))
a.append(list(map(int,input().split(" "))))
array.append(a)
for x in array:
triangle(*x) | 7 | PYTHON3 |
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
int mod = 1000000007;
using namespace std;
bool isp(long long x) {
for (long long i = 2; i * i <= x; ++i)
if (x % i == 0) return false;
return true;
}
void pog() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
}
bool sortinrev(const pair<long long, long long> &a,
const pair<long long, long long> &b) {
return (a.first > b.first);
}
bool prime_check(long long n) {
bool flag = 1;
for (long long i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
flag = 0;
break;
}
}
return flag;
}
long long power(long long x, unsigned long long y, long long p) {
long long res = 1;
x = x % p;
if (x == 0) return 0;
while (y > 0) {
if (y & 1) res = (res * x) % p;
y = y >> 1;
x = (x * x) % p;
}
return res;
}
int32_t main() {
pog();
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
long long arr[n];
for (long long i = 0; i < n; i++) {
cin >> arr[i];
};
long long sum = arr[0] + arr[1];
long long flag = 0;
for (long long i = 2; i < n; i++)
if (sum <= arr[i]) {
flag = i + 1;
break;
}
if (flag)
cout << 1 << " " << 2 << " " << flag << "\n";
else
cout << -1 << "\n";
}
}
| 7 | CPP |
t=int(input())
for o in range(t):
n=int(input())
a=list(map(int,input().split()))
x=a[n-1]
y=a[0]
flag=0
for i in range(1,n-1):
if a[i]+y<=x:
flag=1
break
if flag==1:
print(1,i+1,n)
else:
print(-1) | 7 | PYTHON3 |
t = int(input())
for tt in range(t):
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[n - 1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
from sys import stdin
"""
n=int(stdin.readline().strip())
n,m=map(int,stdin.readline().strip().split())
s=list(map(int,stdin.readline().strip().split()))
s=stdin.readline().strip()
"""
m=int(stdin.readline().strip())
for i in range(m):
n=int(stdin.readline().strip())
s=list(map(int,stdin.readline().strip().split()))
arr=[s[0],s[1],s[-1]]
if arr[-1]>=arr[0]+arr[1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
if l[0]+l[1]<=l[n-1]:
print("1 2",n)
else:
print("-1") | 7 | PYTHON3 |
import os
import sys
from collections import Counter
from io import BytesIO, IOBase
def main():
input = sys.stdin.readline
for t in range(int(input())):
n =int(input())
a = list(map(int, input().split()))
b=[1,2]
for i in range(2,n):
if a[i]>=a[0]+a[1]:
b.append(i+1)
break
if len(b)==2:
print(-1)
else:
print(*b)
# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
self.write = self.buffer.write if self.writable else None
def read(self):
while True:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
if not b:
break
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines = 0
return self.buffer.read()
def readline(self):
while self.newlines == 0:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
self.newlines = b.count(b"\n") + (not b)
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines -= 1
return self.buffer.readline()
def flush(self):
if self.writable:
os.write(self._fd, self.buffer.getvalue())
self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
def __init__(self, file):
self.buffer = FastIO(file)
self.flush = self.buffer.flush
self.writable = self.buffer.writable
self.write = lambda s: self.buffer.write(s.encode("ascii"))
self.read = lambda: self.buffer.read().decode("ascii")
self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
if __name__ == "__main__":
main() | 7 | PYTHON3 |
from math import *
sInt = lambda: int(input())
mInt = lambda: map(int, input().split())
lInt = lambda: list(map(int, input().split()))
t= sInt()
for _ in range(t):
n = sInt()
a = lInt()
if a[0]+a[1]>a[-1]:
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = [int(s) for s in input().split()]
ans = "-1"
if a[0] + a[1] <= a[-1]:
ans = str(1) + " " + str(2) + " " + str(n)
print(ans) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
if (a[0]+a[1]) <= a[-1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
long long mod = 1e9 + 7;
const int N = 5e4 + 10;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
long long T, n, m, x, y, z, ans, tem, cnt;
struct node {
long long id, v;
};
node a[N];
int cmp(node a, node b) { return a.v < b.v; }
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> T;
while (T--) {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i].v;
a[i].id = i;
}
sort(a + 1, a + n + 1, cmp);
if (a[n].v >= a[1].v + a[2].v) {
cout << a[1].id << " " << a[2].id << " " << a[n].id << "\n";
} else
cout << "-1\n";
}
}
| 7 | CPP |
t = int(input())
arrs = []
for i in range(t):
_ = int(input())
arr = [int(j) for j in input().split()]
arrs.append(arr)
for arr in arrs:
a1 = arr[0]
a2 = arr[1]
a3 = arr[-1]
if a1+a2 > a3:
print(-1)
else:
print(1,2,len(arr))
| 7 | PYTHON3 |
for i in range (int(input())):
n=int(input())
l1=list(map(int,input().split()))
if(l1[0]+l1[1]<=l1[n-1]):
print("1 2 ",n)
else:
print(-1)
| 7 | PYTHON3 |
from collections import defaultdict
t=int(input())
for _ in range(t):
n=int(input())
a=list(map(int,input().split()))
mi=a[0]
mx=a[n-1]
flag=0
for i in range(1,n-1):
if(a[i]<=mx-mi):
print(1,i+1,n)
flag=1
break
if(flag==0):
print(-1)
| 7 | PYTHON3 |
t = int(input())
for i in range(t):
n = int(input())
arr = list(map(int, input().split()))
if(arr[0]+arr[1]<=arr[-1]):
print(1, 2, n)
else:
print(-1) | 7 | PYTHON3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.