solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
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) else: print(1,2,n)
7
PYTHON3
for t in range(int(input())): n=int(input()) l=list(map(int,input().split())) c=l[n-1] b=l[1] a=l[0] if a+b<=c or b+c<=a or c+a<=b: print(1,2,n) else: print(-1)
7
PYTHON3
t = int(input()) for _ in range(t): q = int(input()) l = list(map(int, input().split())) if l[0]+l[1] > l[-1]: print(-1) else: print(1, 2, q)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void solve() { long long n, i, x; cin >> n; vector<long long> ar; for (i = 0; i < n; i++) { cin >> x; ar.push_back(x); } if ((ar[0] + ar[1]) <= ar[n - 1]) { cout << 1 << " " << 2 << " " << n << endl; } else { cout << -1 << endl; } } int main(...
7
CPP
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) else: print(1, 2, n)
7
PYTHON3
for _ in range(int(input())): n= int(input()) li= list(map(int, input().strip().split())) if(li[0]+li[1]>li[-1]): print(-1) else: print(1,2,n)
7
PYTHON3
import sys #another one inp=sys.stdin.buffer.readline inin=lambda typ=int: typ(inp()) inar=lambda typ=int: [typ(x) for x in 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
for _ 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, len(l))
7
PYTHON3
for _ in range(int(input())): n=int(input()) l=[int(x) for x in input().split()] h=l[0]+l[1] count=0 for i in range(2,n): if(l[i]>=h): count=1 print("1 2",i+1) break if(count==0): print(-1)
7
PYTHON3
# -*- coding: utf-8 -*- """ Created on Tue Aug 18 00:52:21 2020 @author: RACHIT """ def triplet(arr:list): if len(arr)==0: return [-1] if len(arr)==3: if arr[-1]>=arr[0]+arr[1]: return[1,2,3] return [-1] for i in range(len(arr)-1,2,-1): if arr[i]>arr[0]+arr[1]:...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t; cin >> t; while (t--) { int n; cin >> n; long long int arr[n]; for (int j = 0; j < n; j++) { cin >> arr[j]; } if (arr[0] + arr[1] <= arr[n - ...
7
CPP
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) elif a[-1]>=a[0]+a[1]: print(1,2,n) else: print(-1)
7
PYTHON3
for _ in range(int(input())): n=int(input()) k=list(map(int,input().split())) if (k[0]+k[1]<=k[n-1]): print(1,2,n) else: print(-1)
7
PYTHON3
def fun(ls,n): prv=ls[0] prv_index=0 for i,val in enumerate(ls[1:-1]): i=i+1 nxt_index=i+1 nxt=ls[nxt_index] if(prv+val<=nxt): print(prv_index+1,i+1,nxt_index+1) return prv=val prv_index=i if(ls[0]+ls[1]<=ls[-1]): print(...
7
PYTHON3
def bad_triangle(arr,n): s=arr[0]+arr[1] if s<=arr[n-1]: print(1,2,n) else: print(-1) t=int(input()) for i in range(t): n=int(input()) li=[int(x) for x in input().split()] bad_triangle(li,n)
7
PYTHON3
t=int(input()) while t: t-=1 b=int(input()) a=input().split(" ") if int(a[0])+int(a[1])>int(a[-1]): print(-1) else: print(1,2,b)
7
PYTHON3
t=int(input()) a=[] b=[] for i in range(t): a.append([]) b.append(int(input())) a[i]=[int(a[i]) for a[i] in input().split()] if(a[i][0]+a[i][1]>a[i][b[i]-1]): print('-1') else: print('1 2',end=' ') print(b[i])
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) arr=[int(x) for x in input().split()] x=arr[0]+arr[1] flag=False for i in range(2,n): if arr[i]>=x: flag=True print(1,2,i+1) break if flag==False: print(-1)
7
PYTHON3
t = input() t = int(t) def solve(n, arr): a1 = arr[0] a2 = arr[1] for i in range(2, n): if a1+a2<=arr[i]: print(1, 2, i+1) return print(-1) return for i in range(t): n = input() n = int(n) arr = list(map(int, input().split())) solve(n, arr)
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(1,2,n)
7
PYTHON3
for _ in range(int(input())): n=int(input()) l=[int(x) for x in input().split()] if l[0]+l[1]<=l[len(l)-1]: print(1,end=" ") print(2,end=" ") print(n) else: print(-1)
7
PYTHON3
t = int(input()) for case in range(t): n = int(input()) arr = [*map(int,input().split())] if arr[0]+arr[1]<=arr[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; long long a[50005]; int main() { int i, t, n; scanf("%d", &t); while (t--) { scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%lld", &a[i]); } if (a[0] + a[1] <= a[n - 1]) { printf("1 2 %d\n", n); } else { printf("-1\n"); } ...
7
CPP
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") using namespace std; int arrg[1000000]; int nxt() { int x; cin >> x; return x; } int lxt() { long long x; cin >> x; return x; } int dxt() { double x; cin >> x; return x; } int ldxt() { long double x; cin >> x...
7
CPP
#include <bits/stdc++.h> using namespace std; long long max3(long long a, long long b, long long c) { return max(a, max(b, c)); } long long min3(long long a, long long b, long long c) { return min(a, min(b, c)); } int main() { { int q; cin >> q; while (q--) { int n; cin >> n; vector<...
7
CPP
# def seg_tree(arr,l,r,seg,ind): # if l==r: # seg[ind] = arr[l] # else: # mid = (l+r)//2 # seg_tree(arr,l,mid,seg,2*ind+1) # seg_tree(arr,mid+1,r,seg,2*ind+2) # seg[ind] = seg[2*ind+1]+seg[2*ind+2] # def get_sum(l1,r1,l2,r2,seg,ind): # if l1==l2 and r1==r2: #...
7
PYTHON3
import sys import math def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def MI(): return map(int, sys.stdin.readline().split()) def SI(): return sys.stdin.readline().strip() t = II() for q in range(t): n = II() a = sorted(LI()) if a[0]+a[1]<=a[-1]: pri...
7
PYTHON3
import sys LI=lambda:list(map(int, sys.stdin.readline().strip('\n').split())) MI=lambda:map(int, sys.stdin.readline().strip('\n').split()) SI=lambda:sys.stdin.readline().strip('\n') II=lambda:int(sys.stdin.readline().strip('\n')) for _ in range(II()): n=II() a=LI() if a[0]+a[1]<=a[-1]: print(1, 2, n) else: prin...
7
PYTHON3
#!/usr/bin/env python # -*- coding: utf-8 -*- # # untitled.py # # Copyright 2020 Md Sidratul Muntaher Tibrow <smuntahar@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eith...
7
PYTHON3
for i in range(int(input())): g = input() a = [0] + list(map(int, input().split())) if a[1] + a[2] <= a[-1]: print(1, 2, g) else: print(-1)
7
PYTHON3
T = int(input()) l = [] for k in range(T): N = int(input()) a = list(map(int, input().split())) f=0 for j in range(1,N-1): if a[0]+a[j]<=a[N-1]: l.append([1,j+1,N]) f=1 break if f==0: l.append([-1]) for k in range(T): if l[k][0]==-1: print (-1...
7
PYTHON3
for _ in range(int(input())): n=int(input()) l=list(map(int,input().split())) m=max(l) for i in range(0,n-1): if (l[i]+l[i+1])<=m: print(i+1,i+2,n) break else: print(-1)
7
PYTHON3
import sys from collections import defaultdict # input=sys.stdin.readline for _ in range(int(input())): n=int(input()) lis=list(map(int,input().split())) if lis[0]+lis[1]<=lis[-1]: print(1,2,n) else: print(-1) # for i in range(int(input())): # s=input() # l=[] # c=0 # f...
7
PYTHON3
t = int(input()) anss = [] for _ in range(t): input() l = list(map(int, input().split(sep=' '))) if l[0] + l[1] > l[-1]: anss.append([-1]) else: anss.append([1, 2, len(l)]) for ans in anss: for i in ans: print(i, end = ' ') print()
7
PYTHON3
t = int(input()) a=b=c=0 for i in range(t): f=0 n = int(input()) li = list(map(int,input().split()))[:n] # for j in range(n): # for k in range(j+2,n): # if li[j]+li[j+1]<=li[k]: # a=j+1 # b=j+1+1 # c=k+1 # f=1 # ...
7
PYTHON3
import sys t = int(input()) for _ in range(t): n = int(input()) li = list(map(int, input().split()))[:n] if li[0] + li[1] > li[n - 1]: print(-1) else: print(1, 2, n)
7
PYTHON3
for _ in range(int(input())): n=int(input()) data=[int(x) for x in input().split()] if((data[0]+data[1])<=data[n-1]): print(1,2,n) elif((data[n-1]-data[n-2])>=data[0]): print(1,n-1,n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> int mod = 1000000007; using namespace std; vector<int> v[100001]; void solve() { long long n; cin >> n; long long a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } if (a[0] + a[1] <= a[n - 1]) { cout << "1 " << "2 " << n << " " << endl; } else { cout << "-1 "...
7
CPP
#include <bits/stdc++.h> using namespace std; double pi = 3.14159265358979323846; bool sortbysec(const pair<long long int, long long int> &a, const pair<long long int, long long int> &b) { if (a.first == b.first) return (a.second < b.second); return (a.first < b.first); } long long int fpower(long lo...
7
CPP
# -*- coding: utf-8 -*- """ Created on Sat Aug 15 22:54:54 2020 @author: user """ 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 "+str(n)) else: print(-1)
7
PYTHON3
for _ in range(int(input())): n=int(input()) a=[int(x) for x in input().split()] x=a[0] y=a[1] found=False for i in range(n-2): z=a[2+i] if(x+y<=z): found=True print(1,2,i+3) break if not found:print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) a.sort() if a[0] + a[1] <= a[-1]: print(1, 2, n) elif a[0] >= a[-2] + a[-1]: print(1, n-1, n) else: print(-1)
7
PYTHON3
t=int(input()) while(t): n=int(input()) a=list(map(int,input().split())) b,c,e=a[0],a[1],a[-1] if(b+c<=e): print("1 2 %d"%(n)) else: print("-1") t-=1
7
PYTHON3
import math m=1000000007 def fact(n): ans=1 for i in range(1,n+1): ans=((ans%m)*(i%m))%m return ans def power_2(n): ans=1 for i in range(n): ans=((ans%m)*(2))%m return ans for z in range(int(input())): n=int(input()) flag=True a=[int(i) for i in input().split()] ...
7
PYTHON3
t = int (input ()) inn =[] result=[] c=0 for j in range(t): n = int (input()) inn = [int (a) for a in input().split()] if ((((inn[0]+inn[1])>inn[n-1]) & ((inn[0]+inn[n-1])>inn[1]) & ((inn[1]+inn[n-1])>inn[0])) & (((inn[n-1]+inn[n-2])>inn[0]) & ((inn[n-1]+inn[0])>inn[n-2]) & ((inn[0]+inn[n-2])>inn[n-1]))): ...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const long long LINF = (long long)1e18 + 47; const int INF = 2 * 1e9 + 47; const int MOD = 1e9 + 7; const int modulo = 1e8; const int nax = 3 * (int)1e3 + 10; const double EPS = 1e-7; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int tt; cin >> t...
7
CPP
import math import sys from collections import Counter from math import factorial as fact from collections import defaultdict def inpint(): return int(input()) def inpstr(): return str(input()) def inparr(): return list(map(int,input().strip().split())) def inptup(): return map(int,input().strip().split...
7
PYTHON3
n=int(input()) for i in range(n): flag=0 m=int(input()) a=[int(x) for x in input().split()] if a[0]+a[1]<=a[-1]: print(1,2,m) 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[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { long long int t, k; cin >> t; for (k = 1; k <= t; k++) { long long int n, i, s = 0, f = 0; cin >> n; int a[n]; for (i = 0; i < n; i++) { cin >> a[i]; } s = a[0] + a[1]; for (i = 2; i < n; i++) { if (a[i] >= s) { ...
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int t, n, i; cin >> t; while (t--) { cin >> n; int ar[n]; for (i = 0; i < n; i++) cin >> ar[i]; if (ar[0] + ar[1] <= ar[n - 1]) cout << 1 << ' ' << 2 << ' ' << n << '...
7
CPP
t = int(input()) while t: n = int(input()) sides = list(map(int, input().split())) if sides[0] + sides[1] > sides[-1]: print(-1) else: print(1, 2, n) t -= 1
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int MXN = 5e4 + 5; const int INF = 1e9; const long long P = 29; const long long MOD = 1e9 + 7; int t; int main() { srand(time(0)); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << fixed << setprecision(10); cin >> t; while (t--) { int n...
7
CPP
#list (map(int, input().split())) rw = int(input()) for qwe in range(rw): n = int(input()) a = list(map(int, input().split())) a.reverse() if a[0] >= a[n - 2] + a[n - 1]: print(1, 2, n) else: print(-1)
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) arr = [int(i) for i in input().split()] if arr[0]+arr[1] <= arr[-1]: print(0+1,1+1,n) else: print(-1)
7
PYTHON3
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) if __name__ == '__main__': main()
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 " + str(n)) else: print(-1)
7
PYTHON3
T = int(input()) for t in range(T): 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>0): t-=1 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
#include <bits/stdc++.h> using namespace std; template <typename T> void pr(vector<T> &v) { for (int i = 0; i < (int)(v).size(); i++) cout << v[i] << " "; cout << endl; } template <typename T> void pr(vector<vector<T>> &v) { for (int i = 0; i < (int)(v).size(); i++) { pr(v[i]); } } template <typename T> voi...
7
CPP
try: t=int(input()) for _ in range(t): n=int(input()) flag=0 a=list(map(int,input().split())) if a[-1] >= a[0]+a[1]: print(1,2,n) else: print(-1) except: pass
7
PYTHON3
t = int(input()) while t > 0: n = int(input()) lis = [int(a) for a in input().split()] i = 0 j = n-1 istrue = True while(j >= 2) and istrue: while(i <= j-2) and istrue: if(lis[j] >= lis[i]+lis[i+1]): print(i+1, i+2, j+1) istrue = False break i += 1 j -= 1 if(istrue): print(-1) t -= 1...
7
PYTHON3
n = int(input()) for i in range(n): y = int(input()) a = list(map(int, input().split())) p = 0 q = 0 for k in range(2, y): if(a[0]+a[1]<=a[k]): p = 1 q = k+1 break if(p==0): print(-1) else: print(p, p+1, q)
7
PYTHON3
for _ in range(int(input())): N=int(input()) a=list(map(int,input().split())) x=a[0]+a[1] flag=0 for i in range(2,len(a)): if(a[i]>=x): print(1,2,i+1) flag=1 break if(flag==0): print(-1)
7
PYTHON3
import sys #another one inp=sys.stdin.buffer.readline inin=lambda : int(inp()) inar=lambda typ=int: 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
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); const long long INF = 1LL << 62; const long long MINF = -(1LL << 62); template <typename T> T getint() { T val = 0; char c; bool neg = false; while ((c = getchar()) && !(c >= '0' && c <= '9')) { neg |= c == '-'; } do { val = (...
7
CPP
for _ 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
for _ in range(int(input())): n = int(input()) *arr, = map(int, input().split()) # indices= sorted(range(n), key=lambda idx: arr[idx]) if arr[0] + arr[1] <= arr[-1]: print(1, 2, len(arr)) else: print(-1)
7
PYTHON3
for t in range(int(input())): n=int(input()) l=[int(i) for i in input().split()] if l[0]+l[1]>l[n-1]: print(-1) else: print(1,2,n)
7
PYTHON3
for _ in range(int(input())): n = int(input()) arr = list(map(int, input().split())) if arr[0]+arr[1]<=arr[n-1]: print(1,2,n) else: print("-1")
7
PYTHON3
for t in range(int(input())): n=int(input()) a=[int(i) for i in input().split()] x=1 if a[0]+a[1]<=a[n-1]: print(1,2,n) else: print(-1)
7
PYTHON3
a = int(input()) for i in range(a): b = int(input()) c = list(map(int,input().split())) if c[0] + c[1] > c[-1]: print(-1) else: print(1, 2, len(c))
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; if (a[0] + a[1] <= a[n - 1]) cout << "1 2 " << n << endl; else cout << "-1" << endl; } }
7
CPP
def findTriangle(arr,n): if n < 3: return -1 i = 0 j = 1 k = 2 while k < n-1: if (arr[i]+arr[j] <= arr[k]) or (arr[j]+arr[k] <= arr[i]) or (arr[i]+arr[k] <= arr[j]): return str(i+1)+" "+str(j+1)+" "+str(k+1) k+=1 while j<n-2: if (arr[i]+arr[j] <= arr[k...
7
PYTHON3
t=int(input()) while(t>0): n=int(input()) l=list(map(int,input().split())) s=l[0]+l[1] for i in range(2,n): if l[i]>=s: print(1,2,i+1) break else: print(-1) t-=1
7
PYTHON3
for _ 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
t=int(input()) for _ in range(t): n = int(input()) ar=list(map(int,input().split())) if(ar[0]+ar[1]<=ar[n-1]): print('1 2',end=' ') print(n) else: print('-1')
7
PYTHON3
import math import time from collections import defaultdict,deque,Counter from sys import stdin,stdout from bisect import bisect_left,bisect_right from queue import PriorityQueue import sys t=1 t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,stdin.readline().split())) if(a[-1]>=a[0]+a[1]): ...
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) a=[int(i) for i in input().split()] v=a[0]+a[1] a=a[2:] f=0 for i in range(len(a)): if(v<=a[i]): print("1 2",i+3,end='\n') f=1 break if(not f): print("-1",end='\n')
7
PYTHON3
def f(k,arr): #assert (j==len(arr)) a=arr[0] b=arr[1] for i in range(k): if arr[i]>=(a+b): return('1 2 '+str(i+1)) return '-1' a=input() n=int(a) for i in range(n): j=int(input()) a=list(map(int,input().rstrip().split())) print(f(j,a))
7
PYTHON3
from sys import stdin def main(): input = lambda: stdin.readline()[:-1] T = int(input()) for _ in [0] * T: N = int(input()) A = list(map(int, input().split())) if A[0] + A[1] <= A[-1]: print(1, 2, N) else: print(-1) main()
7
PYTHON3
import sys from math import ceil, factorial, gcd #from math import comb, perm only in python3 from collections import Counter, deque, defaultdict from bisect import bisect_left, bisect_right from heapq import heappop, heappush, heapify MOD = 10**9 + 7 INF = float('inf') rl = lambda : list(map(int, sys.stdin.readline...
7
PYTHON3
for t in range(int(input())): n = int(input()) a = list(map(int,input().split(" "))) a.sort() if a[0]+a[1] > a[n-1]: print(-1) else: print(1,2,n)
7
PYTHON3
def sum(n,a): if a[0]+a[1]<=a[n-1]: print(1,2,n,"\n") else: print(-1,"\n") t=int(input()) for e in range (t): n=int(input()) a=list(map(int,input().split())) sum(n,a)
7
PYTHON3
for i in range(int(input())): n = int(input()) a = list(map(int,input().split())) if a[0]+a[1]<=a[-1]: print(1,2,len(a)) else: print(-1)
7
PYTHON3
for _ in range(int(input())): n=int(input()) d={} l=[int(i) for i in input().split()] mn=10000000000000 idx=0 for i in range(n): if l[i]<mn: mn=l[i] idx=i d[idx]=l[idx] mn=10000000000000 idx=-1 for i in range(n): if i not in d:...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); 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]; } long long int x, y, z; x ...
7
CPP
for i1 in range(int(input())): n=int(input()) a=list(map(int,input().split())) t1=a[0] t2=a[1] t3=a[-1] if t3>=(t1+t2): print(1,2,n) continue else: print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) a = [*map(int,input().split())] ok = 0 for i in range(2,n): if(a[i]>=a[0]+a[1]): print(1,2,i+1) ok = 1 break if(not ok): print(-1)
7
PYTHON3
import math, sys from collections import defaultdict, Counter, deque INF = float('inf') MOD = (10 ** 9) + 7 def gcd(a, b): while b: a, b = b, a%b return a def isPrime(n): if (n <= 1): return False i = 2 while i ** 2 <= n: if n % i == 0: return False i += 1 return True def primeFactors(n): fac...
7
PYTHON3
# cook your dish here from sys import stdin, stdout import math from itertools import permutations, combinations from collections import defaultdict from bisect import bisect_left from bisect import bisect_right def L(): return list(map(int, stdin.readline().split())) def In(): return map(int, stdin.readli...
7
PYTHON3
for _ in range(int(input())): le = int(input()) f, s, *_, la = [int(i) for i in input().split()] print(1, 2, le) if f + s <= la else print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while (T--) { int n; cin >> n; int A, B, C; cin >> A >> B; for (int i = 3; i <= n - 1; i++) cin >> C; cin >> C; if (A + B <= C) cout << "1 2 " << n; else cout << -1; cout << "\n"; } }
7
CPP
import sys input = sys.stdin.readline I = lambda : list(map(int,input().split())) t,=I() for _ in range(t): n,=I() l=I() an=-1 i=0 if n>=3 and l[i]+l[i+1]<=l[n-1]: print(1,2,n) else: print(-1)
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) a=list(map(int,input().split())) i,j,k=0,1,2 flag=0 while(i<n and j<n and k<n): if(a[i]+a[j]<=a[k]): flag=1 break else: k+=1 if(flag==1): print(i+1,j+1,k+1) else: print(-1) ...
7
PYTHON3
import sys import math import heapq import collections fast_reader = sys.stdin.readline fast_writer = sys.stdout.write def input(): return fast_reader().strip() def print(*argv): fast_writer(' '.join((str(i)) for i in argv)) fast_writer('\n') def printspace(*argv): fast_writer(' '.join((str(i)) for i in argv)) fas...
7
PYTHON3
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
from math import * import sys, random def nextInt(): return int(input()) def nextStrs(): return input().split() def nextInts(): return list(map(int,nextStrs())) def can(i,j,k): if i+j > k: return True return False def main(): t = nextInt() while t > 0: n = nextInt() ...
7
PYTHON3
import collections as cc I=lambda:list(map(int,input().split())) for tc in range(int(input())): n,=I() l=sorted(I()) if (l[0]+l[1]<=l[-1]): print(1,2,n) else: print(-1)
7
PYTHON3
def checker(n, lst): if lst[0] + lst[1] <= lst[-1]: return 1, 2, n return -1, for _ in range(int(input())): m = int(input()) a = [int(i) for i in input().split()] print(*checker(m, a))
7
PYTHON3