solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
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
for _ in range(int(input())): 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
t = int(input()) for _ in range(t): n = int(input()) f = list(map(int, input().split())) if f[0]+f[1]<=f[-1]: print(1,2,n) else: print(-1 )
7
PYTHON3
for t 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
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t, n, i; cin >> t; while (t--) { cin >> n; long long int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; } if (a[0] + a[1] > a[n - 1]) { cout << -1 << endl; } else {...
7
CPP
t=int(input()) for i in range(t): n=int(input()) ar=[int(i) for i in input().split()] b=ar[0] a=ar[1] c=ar[-1] if a+b<=c: print(str(1)+' '+str(2)+' '+str(n)) else: print(-1)
7
PYTHON3
for test in range(int(input())): n = int(input()) l = list(map(int, input().strip().split(" "))) if l[-1] >= l[0] + l[1]: print(1, 2, n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> int main() { int t; scanf("%d", &t); while (t--) { long long int n, i, j, k, f = 0; scanf("%lld", &n); long long int a[n]; for (i = 0; i < n; i++) scanf("%lld", &a[i]); for (i = 2; i < n; i++) { if (a[i] >= a[0] + a[1]) { f = 1; break; } ...
7
CPP
from sys import stdin input=stdin.readline def A(): t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,input().split())) a.sort() found=False if a[0]+a[1] <= a[n-1]: print(1,2,n) else: print(-1) def B(): t=int(input()) for _ in rang...
7
PYTHON3
import random def gcd(a, b): if a == 0: return b return gcd(b % a, a) def lcm(a, b): return (a * b) / gcd(a, b) for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) #= map(int, input().split()) f=a[0] s=-1 t=a[n-1] for i in range(1,n-1)...
7
PYTHON3
import sys #another one inp=sys.stdin.buffer.readline def inin(typ=int): return typ(inp()) def inar(typ=int): return list(map(typ,inp().split())) inst=lambda : inp().decode().strip() _T_=inin() for _t_ in range(_T_): n=inin() a=inar() if a[0]+a[1]>a[n-1]: print(-1) else: print(1,2,n)
7
PYTHON3
t=int(input()) while(t>0): n=int(input()) ar=list(map(int, input().split())) if ar[0]+ar[1]<=ar[n-1]: print(1, 2, n) else: print(-1) t-=1
7
PYTHON3
for i in range(int(input())): f = 0 n = int(input()) s = list(map(int, input().split())) if s[0]+s[1]>s[len(s)-1]: print("-1") else: print("1",end=" ") print("2",end=" ") print(n)
7
PYTHON3
# Author: S Mahesh Raju # Username: maheshraju2020 # Date: 14/08/2020 from sys import stdin, stdout, setrecursionlimit from math import gcd, ceil, sqrt from collections import Counter, deque from bisect import bisect_left, bisect_right ii1 = lambda: int(stdin.readline().strip()) is1 = lambda: stdin.readline().strip() ...
7
PYTHON3
for _ in range(int(input())): am = int(input()) arr = list(map(int,input().split())) if arr[0] + arr[1] > arr[-1]: print(-1) else: print(1,2,am)
7
PYTHON3
t = int(input()) while t > 0: t -= 1 n = int(input()) a = list(map(int, input().split())) ans = [-1] if a[-1] >= a[0] + a[1]: ans = [1,2,n] if len(ans) == 1: print(ans[0]) else: print(ans[0], ans[1], ans[2])
7
PYTHON3
for T 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
import os import sys import math import heapq from decimal import * from io import BytesIO, IOBase from collections import defaultdict, deque def r(): return int(input()) def rm(): return map(int,input().split()) def rl(): return list(map(int,input().split())) for _ in range(r()): n = r() a = rl()...
7
PYTHON3
T = int(input()) for _ in range(T): n = int(input()) a = list(map(int, input().split())) h = sorted(a) kel = max(a) if h[0]+h[1]<=kel: fir = h[0] sec = h[1] for i in range(n): if a[i]==fir: print(i+1,end=' ') yu = i break for i in range(n): if a[i]==sec and i!=yu: print(i+1,end=' ') ...
7
PYTHON3
t=int(input()) def fn(): n=int(input()) l=list(map(int,input().split())) #sl=set(l) i=0 j=1 k=n-1 while(i<j<k): if(l[i]+l[j] > l[k]): i+=1 j+=1 else: return [i+1,j+1,k+1] return [-1] while(t): print(*fn()) t-=1
7
PYTHON3
for _ in range(int(input())): n = int(input()) u = list(map(int, input().split())) if u[0] + u[1] <= u[-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; long long MOD = 998244353; const long long L_INF = 1LL << 60; const long long INF = 2147483647; const double PI = acos(-1); template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chma...
7
CPP
for i in range(0,int(input())): n=int(input()) list1 = list(map(int,input().strip().split()))[:n] if list1[0]+list1[1]<=list1[n-1]: print(1,2,n) else: print(-1)
7
PYTHON3
def badt(n,a): if a[0]+a[n//2]<=a[n-1]: return [1,n//2+1,n] else: for i in range(1,n//2): sum = a[0]+a[i] if sum<=a[n-1]: return [1,i+1,n] return [-1] if __name__ == '__main__': n = int(input()) res = [] for i in range(n): ...
7
PYTHON3
t = int(input()) while t != 0: n = int(input()) txt = input() v = txt.split(" ") if int(v[0]) + int(v[1]) <= int(v[n - 1]): print(1, 2, n) else: print(-1) t -= 1
7
PYTHON3
import heapq for _ in range(int(input())): heap = [] n = int(input()) x = list(map(int, input().split())) for i in x: heapq.heappush(heap, i) a = heapq.heappop(heap) i = x.index(a) b = heapq.heappop(heap) if a==b: j = i+1 else: j = x.index(b) y = max(x) ...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long int n, i, j; cin >> n; vector<long long int> v; long long int h; for (i = 0; i < n; i++) { cin >> h; v.push_back(h); } long long int a, b, c; a = v[0]; b = v[1]; ...
7
CPP
#include <bits/stdc++.h> using namespace std; long long n, t, a[50006]; int main() { cin >> t; while (t--) { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } if ((a[2] + a[1]) <= a[n]) { cout << "1 2 " << n << endl; ; } else cout << "-1" << endl; } return 0; }
7
CPP
for t in range(int(input())): n=int(input()) a=list(map(int,input().split())) i=0 y=1 for z in range(2,n): if(a[i]+a[y]<=a[z]): break if(i==z or a[i]+a[y]>a[z]): print(-1) else: print(i+1,y+1,z+1)
7
PYTHON3
t=int(input()) for _ in range(t): n=int(input()) li=list(map(int,input().split())) i=0 j=1 k=n-1 while(k>j): if li[i]+li[j]<=li[k]: break else: i=j j+=1 if k>j: print(i+1,j+1,k+1) else: print(-1)
7
PYTHON3
for testcases in range(int(input())): num=int(input()) lis=list(map(int,input().split())) a=lis[0] b=lis[1] c=lis[-1] if(c>=(a+b)): print(1,2,num) else: print(-1)
7
PYTHON3
import sys,bisect,string,math,time,functools,random,fractions from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter from itertools import permutations,combinations,groupby rep=range;R=range def Golf():n,*t=map(int,open(0).read().split()) def I():return int(input()) def S_():return...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<long long int> v(n); for (long long int i = 0; i < n; ++i) cin >> v[i]; if (v[0] + v[1] <= v.back()) { cout << "1 2 " << v.size(); return; } cout << -1; } int main() { ios::sync_with_stdio(0); cin.tie(0); co...
7
CPP
def multi_input(): return map(int, input().split()) def array_print(arr): print(' '.join(map(str, arr))) for i in range(int(input())): n = int(input()) arr = list(multi_input()) if arr[0] + arr[1] <= arr[-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { long long int t, i, j; cin >> t; for (i = 1; i <= t; i++) { long long int n; cin >> n; long long int a[n + 1]; for (j = 1; j <= n; j++) { cin >> a[j]; } if ((a[1] + a[2]) <= a[n]) { cout << 1 << " " << 2 << " " << n << ...
7
CPP
for ii 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
from sys import stdin input = stdin.readline for _ in range(int(input())): n = int(input()) a = [*map(int, input().split())] if a[0] + a[1] <= a[-1]: print(1,2,n) else: print('-1')
7
PYTHON3
# imports # helpers # solution def solution(n, nums): first = nums[0] last = nums[n-1] for i in range(1, n-1): if first+nums[i] <= last: return f"1 {i+1} {n}" return -1 # setup if __name__ == '__main__': tests = int(input().strip()) for _ in range(tests): n = int(i...
7
PYTHON3
#_________________ Mukul Mohan Varshney _______________# #Template import sys import os import math import copy from math import gcd from bisect import bisect from io import BytesIO, IOBase from math import sqrt,floor,factorial,gcd,log,ceil from collections import deque,Counter,defaultdict from itertools import permu...
7
PYTHON3
for t in range(int(input())): n = int(input()) *a, = map(int, input().split()) if (a[0]+a[1]) <= a[-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
def solve(n, lst): if lst[0]+lst[1]>lst[-1]: return -1 else: return '1 2 '+str(n) t = int(input()) for _ in range(t): n = int(input()) lst = list(map(int, input().split(' '))) print(solve(n, lst))
7
PYTHON3
t = int(input()) for i in range(t): n = int(input()) lst = list(map(int,input().split())) if lst[0]+lst[1]<=max(lst): print(1,2,lst.index(max(lst))+1) else: print(-1)
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) a=list(map(int,input().split())) aj=0 #a.sort() if(a[0]+a[1]<=a[n-1]): print(1,2,n) else: print(-1)
7
PYTHON3
t = int(input()) def solve(): n = int(input()) arr = list(map(int, input().split())) maximum = arr[-1] minimum = arr[0] second = arr[1] if(minimum + second <= maximum): print(1,2,len(arr)) else: print(-1) for i in range(t): solve()
7
PYTHON3
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools # import time,random,resource sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 10**9+7 mod2 = 998244353 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI():...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int32_t main() { long long int t; cin >> t; while (t--) { long long int n; cin >> n; long long int a[n]; for (long long int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); if (a[0] + a[1] > a[n - 1]) cout << -1 << endl; ...
7
CPP
t=int(input()) while t>0: n =int(input()) g=list(map(int, input().split())) if g[0]+g[1]<=g[n-1]: print("1 2 {}".format(n)) else: print(-1) t-=1
7
PYTHON3
import os inp=os.read(0,os.fstat(0).st_size).split(b"\n");_ii=-1 _DEBUG=1 def debug(*args): if _DEBUG: import inspect frame = inspect.currentframe() frame = inspect.getouterframes(frame)[1] string = inspect.getframeinfo(frame[0]).code_context[0].strip() arns = string[string.f...
7
PYTHON3
def f(): n = int(input()) a = [int(i)for i in input().split()] for i in range(2,n): if a[0]+a[1]<=a[i]: print(1,2,i+1) return print(-1) for _ in range(int(input())): f()
7
PYTHON3
def solve(arr,n): if(arr[0]+arr[1]<=arr[-1]): print(1,2,n) else: print(-1) t=int(input()) for _ in range(t): n=int(input()) arr= list(map(int,input().split())) solve(arr,n)
7
PYTHON3
def f(a): if a[0]+a[1]<=a[-1]: return [1,2,len(a)] return -1 for _ in range(int(input())): n=int(input()) #e=[int(x) for x in input().split()] #a=list(input()) #b=list(input()) a=[int(x) for x in input().split()] r=f(a) if r==-1: print(-1) else: ...
7
PYTHON3
# begin FastIO2 import os inp=os.read(0,os.fstat(0).st_size).split(b"\n");_ii=-1 def rdln(): global _ii _ii+=1 return inp[_ii] inin=lambda typ=int: typ(rdln()) inar=lambda typ=int: [typ(x) for x in rdln().split()] inst=lambda: rdln().strip().decode() # end FastIO # begin DEBUG _DEBUG=0 def debug(*args): ...
7
PYTHON3
t=int(input()) while t: n=int(input()) a=list(map(int,input().split())) x=a[0] y=a[1] z=a[-1] if x+y<=z: print (1,2,n) else: print (-1) t=t-1
7
PYTHON3
import sys, math import io, os #data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline from bisect import bisect_left as bl, bisect_right as br, insort from heapq import heapify, heappush, heappop from collections import defaultdict as dd, deque, Counter #from itertools import permutations,combinations def data(): ...
7
PYTHON3
# https://codeforces.com/contest/1398/problem/0 import sys reader = (s.rstrip() for s in sys.stdin) input = reader.__next__ # do magic here t = int(input()) for _ 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(-...
7
PYTHON3
from sys import stdin tt = int(stdin.readline()) for loop in range(tt): n = int(stdin.readline()) a = list(map(int,stdin.readline().split())) if a[0] + a[1] <= a[n-1]: print (1,2,n) else: print (-1)
7
PYTHON3
for _ in range(int(input())): n=int(input()) arr=list(map(int,input().split())) x=arr[0] y=arr[1] z=arr[n-1] if x+y<=z: print(1,2,n) else: print(-1)
7
PYTHON3
n = int(input()) for _ in range(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
from sys import stdin, stdout import heapq import cProfile from collections import Counter, defaultdict, deque from functools import reduce import math def get_int(): return int(stdin.readline().strip()) def get_tuple(): return map(int, stdin.readline().split()) def get_list(): return list(map(int, st...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v[i]; } if (v[n - 1] >= v[0] + v[1]) cout << 1 << " " << 2 << " " << n << endl; else ...
7
CPP
for i in range(int(input())): n =int(input()) lst=list(map(int,input().split())) A=lst A.sort() a1=[] b=1 first=A[0] second=A[1] for i in range(2,n): if(first+second<=A[i] or first+A[i]<=second or second+A[i]<=first): print(1,2,i+1) b=0 break if(b==1): print(-1)
7
PYTHON3
for i in [0]*int(input()): a=input() l=list(map(int,input().split())) if l[0]+l[1]>l[-1]: print(-1) else: print(1,2,a)
7
PYTHON3
t = int(input()) while t > 0: n = int(input()) arr = list(map(int , input().split())) flag = True sum = arr[0] + arr[1] for j in range(2 , n): if sum <= arr[j]: flag = False break if flag == False: print(1,2,j+1) else: print(-1) t -= 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) else: print(f'1 2 {n}')
7
PYTHON3
'''Author: Pranit Bhujel''' import re ls = lambda : list(map(int, input().split())) ip = lambda : int(input()) sip = lambda : input() r = lambda a : range(a) lcm = lambda a, b: abs(a*b) // math.gcd(a, b) '''showtime''' if __name__=="__main__": t = ip() ''' looping through test cases ''' for _ in r(t): ...
7
PYTHON3
t=int(input()) for _ in range(t): n=int(input()) l=list(map(int,input().split())) f=0 for x in range(n-2): if l[x]+l[x+1]<=l[n-1]: print(x+1,x+2,n) f=1 break if(f==0): print(-1)
7
PYTHON3
def f(n,l): for i in range(l-2): for ii in range(1,l-1): for iii in range(2,l): if n[iii]>=n[ii]+n[i]: return (i+1,ii+1,iii+1) return [-1] for _ in range(int(input())): l = int(input()) n = [int(x) for x in input...
7
PYTHON3
import sys input = sys.stdin.readline for f in range(int(input())): n=int(input()) a=list(map(int,input().split())) if a[0]+a[1]>a[-1]: print(-1) else: print(1,2,n)
7
PYTHON3
for Cyaka_blyat in range(int(input())): n = int(input()) a = list(map(int, input().split())) if a[0] + a[1] > a[-1]: print(-1) else: print(1, 2, n)
7
PYTHON3
import sys inp=sys.stdin.buffer.read().split(b"\n");_ii=-1 def rdln(): global _ii _ii+=1 return inp[_ii] inin=lambda: int(rdln()) inar=lambda: [int(x) for x in rdln().split()] inst=lambda: rdln().decode() _T_=inin() for _t_ in range(_T_): n=inin() a=inar() if a[0]+a[1]>a[n-1]: print(-1) ...
7
PYTHON3
def deg(arr): ma=arr[-1] if (arr[0]+arr[1])>ma: return -1 else: return (1,2,len(arr)) t=int(input()) for i in range(t): n=int(input()) arr1=[int(k) for k in input().split()] t=deg(arr1) if t==-1: print(-1) else: print(t[0],t[1],t[2])
7
PYTHON3
for _ in range(int(input())): n=int(input()) arr=list(map(int,input().split())) if arr[0]+arr[1]>arr[-1]: print(-1) else: print(1,2,n)
7
PYTHON3
t = int(input()) while(t): n = int(input()) arr = list(map(int, input().split())) flag1=0 index=n-1 if (arr[0]+arr[1]<=arr[n-1]): print(1,2,n) else: print(-1) t-=1
7
PYTHON3
t = int(input()) while t: t -= 1 n = int(input()) lis = [*map(int, input().split())] if lis[0] + lis[1] <= lis[n - 1]: print(1, 2, n) else: print(-1)
7
PYTHON3
t = int(input()) while t>0: t-=1 n = int(input()) a = [[int(x),0] for x in input().split()] for i in range(n): a[i][1] = i+1 a.sort(key=lambda x: x[0]) if a[-1][0] >= a[0][0]+a[1][0]: print(a[0][1], a[1][1], a[-1][1]) else: print(-1)
7
PYTHON3
x=int(input()) for i in range(0,x): n=int(input()) m=list(map(int,input().split()))[:n] if(m[0]+m[1]>m[-1]): print(-1) else: print(1,2,n)
7
PYTHON3
t=int(input()) while (t>0): n=int(input()) arr=input().split() arr=[int(i) for i in arr] if (arr[0]+arr[1]>arr[n-1] and arr[1]+arr[n-1]>arr[0] and arr[n-1]+arr[0]>arr[1]): print(-1) else: print(1,2,n) t-=1
7
PYTHON3
for i in range(0,int(input())): n=int(input()) a=list(map(int,input().split())) f=0 for j in range(2,n): if(a[0]+a[1]>a[j]): continue else: f=1 print(1,2,j+1) break if(f==0): print("-1")
7
PYTHON3
'''input 3 7 4 6 11 11 15 18 20 4 10 10 10 11 3 1 1 1000000000 ''' import math import sys import itertools import random import bisect import heapq import collections def lcm(x, y): return (x*y)//math.gcd(x,y) def hcf(x, y): return math.gcd(x, y) def primes(n): prime=[True for _ in range(0, n+1)] res=[] p=2 whi...
7
PYTHON3
from sys import stdin def inp(): return stdin.buffer.readline().rstrip().decode('utf8') def itg(): return int(stdin.buffer.readline()) def mpint(): return map(int, stdin.buffer.readline().split()) # ############################## import # ############################## main # def solve(): for case i...
7
PYTHON3
for _ in range(int(input())): x = int(input()) #n, m = map(int, input().split()) A = list(map(int, input().split())) if A[0] + A[1] > A[-1]: print(-1) else: print(1, 2, x)
7
PYTHON3
for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) l=0;l1=1;l2=2 t=0 while l2<n: #print(a[l]+a[l1],a[l2]) if a[l]+a[l1]>a[l2]: l2+=1 else: print(l+1,l1+1,l2+1) t=1 break if t==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(1,2,n) else: print('-1')
7
PYTHON3
for _ in range(int(input())): n=int(input()) lst=list(map(int,input().split())) if lst[0]+lst[1]<=lst[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
#include <CodeforcesSolutions.h> #include <ONLINE_JUDGE <solution.cf(contestID = "1398",questionID = "A",method = "GET")>.h> """ Author : thekushalghosh Team : CodeDiggers I prefer Python language over the C++ language :p :D Visit my website : thekushalghosh.github.io """ import sys,math,cm...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int maxn = 100000 + 5; int a[maxn]; int main() { int t; cin >> t; while (t--) { int n; cin >> n; for (int i = 1; i <= n; i++) { scanf("%d", &a[i]); } if (a[1] + a[2] <= a[n]) { cout << 1 << " " << 2 << " " << n << endl; } else...
7
CPP
t=int(input()) for i in range(t): n=int(input()) a=[int(j) for j in input().split(" ")] for k in range(2,n): if (a[0]+a[1])<=a[k]: print(1,2,k+1) break else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const long long int mod = 1e9 + 7; const long long int inf = 2e9 + 5; double PI = 3.14159265358979323846; void solve() { long long int n; cin >> n; long long int aa[n]; for (int i = 0; i < n; i++) { cin >> aa[i]; } long long int a = aa[0], b = aa[1], c = aa[...
7
CPP
import sys input = lambda: sys.stdin.readline().rstrip() for _ in range(int(input())): n=int(input()) a=[int(i) for i in input().split()] if a[0]+a[1]<=a[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
for _ in range (int(input())): n=int(input()) a=list(map(int,input().split())) s=a[0]+a[1] f=0 for i in range (2,n): if s<=a[i]: print("1 2",i+1) f=1 break if f==0: print("-1")
7
PYTHON3
import os import heapq import sys,threading import math import bisect import operator from collections import defaultdict sys.setrecursionlimit(10**5) from io import BytesIO, IOBase def gcd(a,b): if b==0: return a else: return gcd(b,a%b) def power(x, p,m): res = 1 while p: if p ...
7
PYTHON3
import bisect t = int(input()) for _ in range(t): n = int(input()) A = list(map(int,input().split())) if A[-1] >= A[0]+A[1]: print(1,2,n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void __print(float x) { cer...
7
CPP
t=int(input()) for tt in range(t): n=int(input()) a=[int(x) for x in input().split(' ')] a.sort() if(a[0]+a[1]>a[-1]): print(-1) else: print(1,2,n)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } if (arr[n - 1] >= arr[0] + arr[1]) { cout << "1 2 " << n << "\n"; ...
7
CPP
t=int(input()) while t: n = int(input()) a = list(map(int, input().split())) if a[0] + a[1] <= a[-1]: print(1, 2, n) else: print(-1) t-=1
7
PYTHON3
def solve(): n = int(input()) a = [int(x) for x in input().split(' ')] if a[0] + a[1] <= a[n-1]: print(1, 2, n) else: print(-1) def main(): T = int(input()) while T > 0: T -= 1 solve() main()
7
PYTHON3
import os inp=os.read(0,os.fstat(0).st_size).split(b"\n");_ii=-1 def rdln(): global _ii _ii+=1 return inp[_ii] inin=lambda typ=int: typ(rdln()) inar=lambda typ=int: [typ(x) for x in rdln().split()] inst=lambda: rdln().strip().decode() _T_=inin() for _t_ in range(_T_): n=inin() a=inar() if a[0]+a...
7
PYTHON3
def tri(): n=int(input()) for i in range(n): a=int(input()) b=input().strip().split() if int(b[0])+int(b[1])<=int(b[len(b)-1]): print(1,2,len(b)) else: print(-1) tri()
7
PYTHON3
# by the authority of GOD author: manhar singh sachdev # import os,sys from io import BytesIO, IOBase def main(): 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) #Fast...
7
PYTHON3