solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
def main(): for _ in range(int(input())): s = int(input()) l = [int(i) for i in input().split()] if l[0] + l[1] > l[-1]: print(-1) else: print(1,2, s) main() #
7
PYTHON3
t=int(input()) for i in range (t): n=int(input()) arr=list(map(int,input().split())) flag=0 for j in range(n-2) : if flag==1: break for k in range (n-1,j+1,-1): if arr[k] >= arr[j]+arr[j+1]: print (j+1,j+2,k+1) flag=1 ...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; inline int Int() { int x; cin >> x; return x; } inline long long Long() { long long x; cin >> x; return x; } inline float Float() { float x; cin >> x; return x; } inline double Double() { double x; cin >> x; return x; } inline void Yes() { cout << "Y...
7
CPP
''' ___ ___ ___ ___ ___ ___ /\__\ /\ \ _____ /\ \ /\ \ /\ \ /\__\ /:/ _/_ \:\ \ /::\ \ \:\ \ ___ /::...
7
PYTHON3
from __future__ import division, print_function # import threading # threading.stack_size(2**27) # import sys # sys.setrecursionlimit(10**7) # sys.stdin = open('inpy.txt', 'r') # sys.stdout = open('outpy.txt', 'w') from sys import stdin, stdout import bisect #c++ upperbound import math import heapq i_m=92233...
7
PYTHON3
for i in range(int(input())): n = int(input()) arr = [i for i in map(int,input().split())] sorted(arr) if(arr[0]+arr[1]<=arr[n-1]): print(f"1 2 {n}") else: print(-1)
7
PYTHON3
import sys I = lambda: int(input()) RL = readline = lambda: sys.stdin.readline().strip('\n') RM = readmap = lambda x = int: map(x,readline().split(' ')) #A for _ in range(I()): n,l = I(),[*RM()] if l[0]+l[1] <= l[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
import sys from sys import stdin import math #Find Set LSB = (x&(-x)), isPowerOfTwo = (x & (x-1)) def iinput(): return int(input()) def minput(): return map(int,input().split()) def linput(): return list(map(int,input().split())) def fiinput(): return int(stdin.readline()) def fminput(): return map...
7
PYTHON3
def solve(n, arr): val = arr[0] + arr[1] for i in range(2, n): if val <= arr[i]: print(1, 2, i+1) return for j in range(n-2): if arr[j] + arr[j+1] <= arr[j+2]: print(j+1, j+2, j+3) return else: continue print(-1) for...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void solve() { long long n, i; cin >> n; vector<long long> v(n); for (i = 0; i < n; i++) cin >> v[i]; if (v[0] + v[1] <= v[n - 1]) cout << '1' << " " << '2' << " " << n << "\n"; else cout << "-1" << "\n"; return; } int main() { ios_base::syn...
7
CPP
#include <bits/stdc++.h> using namespace std; long long GCD(long long x, long long y) { if (y == 0) return x; return GCD(y, x % y); } long long LCM(long long x, long long y) { return (x * y) / (GCD(x, y)); } long long LOGK(long long x, long long k) { if (x >= k) return 1 + LOGK(x / k, k); return 0; } long long ...
7
CPP
t = int(input()) res = [] for _ in range(t): n = int(input()) A = list(map(int, input().split())) if A[0] + A[1] <= A[-1]: res.append('{} {} {}'.format(1, 2, n)) else: res.append('-1') print('\n'.join(res))
7
PYTHON3
# cook your dish here for _ in range(int(input())): k = int(input()) l = list(map(int,input().split())) a = 0 v = l[0]+l[1] for i in range(2,len(l)): if v<=l[i]: z = i+1 a = 1 break if a == 1: print(1,2,z) else: print(-1)
7
PYTHON3
# -*- coding: utf-8 -*- for i 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
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) x, y = a[0], a[1] f = False for i in range(2, n): if x + y <= a[i]: print(1, 2, i + 1) f = True break if not f: print(-1)
7
PYTHON3
#include <bits/stdc++.h> int main() { int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n); int a[50005]; for (int x = 0; x < n; x++) { scanf("%d", &a[x]); } if (a[0] + a[1] > a[n - 1]) { printf("-1\n"); } else { printf("1 2 %d\n", n); } } return 0; }
7
CPP
import sys import heapq, functools, collections import math, random from collections import Counter, defaultdict # available on Google, not available on Codeforces # import numpy as np # import scipy def solve(lst): # fix inputs here console("----- solving ------") lst = sorted(lst) if lst[0] + lst[1]...
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) l=list(map(int,input().split())) if(l[-1]<l[0]+l[1]): print("-1\n") else: print("1 2",n,'\n')
7
PYTHON3
#!/usr/bin/env python3 ''' Author: andyli Time: 2020-08-14 22:35:30 ''' import os from io import BytesIO, IOBase import sys 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) else: p...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int n; const int N = 5e4 + 10; int a[N]; void solve() { cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; cout << (a[0] + a[1] > a[n - 1] ? "-1" : "1 2 " + to_string(n)) << "\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t ...
7
CPP
for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) x=a[0] y=a[1] c=0 k=0 for i in range(2,n): if x+y<=a[i]: c=0 k=i break else: c=c+1 if c==0: ...
7
PYTHON3
for tt in range(int(input())): 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
def triangle(a): j=len(a)//2 for i in range(len(arr)): while(j<len(arr)): if a[i]+a[i+1]<=a[j]: print(i+1,i+2,j+1) return j+=1 print(-1) n=int(input()) for i in range(n): m=int(input()) arr=[0]*m arr=list(map(int,input().split())) ...
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) arr = list(map(int, input().split())) a = arr[0] b = arr[1] flag = False for i in range(2, n): if (a + b) <= arr[i]: print(1, 2, i + 1) flag = True break if flag is False: print(-1)
7
PYTHON3
from sys import stdin, stdout from collections import Counter,deque import math input = stdin.readline print = stdout.write def inpn(): return(int(input())) def inpl(): return(list(map(int,input().split()))) def inps(): return input() def invr(): return (map(int, input().split())) def outs(s): print...
7
PYTHON3
for _ in range(int(input())): n=int(input()) a=list(map(int,input().split()));a.sort() k=a[0]+a[1];c=0 for i in range(2,n): if a[i]>=k: b=i;c=1 break if c==0: print(-1) else: print(1,2,b+1)
7
PYTHON3
test = int(input()) for _ in range(test): n = int(input()) arr = list(map(int, input().split())) t = arr[0]+arr[1] o = arr[-1] if t<=o: print(1, end=' ') print(2, end=' ') print(n) else: print(-1)
7
PYTHON3
t=int(input()) for k in range(t): n=int(input()) flag=0 a= list(map(int,input().split())) temp=a[0]+a[1] if(a[n-1]>=temp): print(1,2,n) else: print(-1)
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) i = 0 j = 1 k = 2 breaked = False while i < n and j < n: if a[i] + a[j] <= a[k]: print(i+1, j+1, k+1) breaked = True break if k < n-1: k +=...
7
PYTHON3
T = int(input()) for i in range(T): n = int(input()) arr = list(map(int, input().split())) a, b, c = arr[0], arr[1], arr[-1] if a+b <= c: print(1, 2, n) else: print(-1)
7
PYTHON3
import sys input = sys.stdin.readline from collections import * for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) x, y, z = a[0], a[1], a[-1] if z>=x+y: print(1, 2, n) else: print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) b = list(map(int, input().split())) ans = False for i in range(2, len(b)): if b[0]+b[1] <= b[i]: ans = True print(1, 2, i+1) break if ans == False: print(-1)
7
PYTHON3
# -*- coding: utf-8 -*- """ Created on Mon Aug 3 21:10:40 2020 @author: dennis """ import atexit import io import sys _INPUT_LINES = sys.stdin.read().splitlines() input = iter(_INPUT_LINES).__next__ _OUTPUT_BUFFER = io.StringIO() sys.stdout = _OUTPUT_BUFFER @atexit.register def write(): sys.__stdout__.write(_...
7
PYTHON3
# cook your dish here t = int(input()) while t: n = int(input()) l = list(map(int,input().split())) i = 0 j = 1 count = 0 for k in range(2,n): if (l[k])>=(l[i]+l[j]): print(f'{i+1} {j+1} {k+1}') count = 1 break if count ==0: print('-1') ...
7
PYTHON3
for _ in range(int(input())): n = int(input()) arr = list(map(int, input().split())) arr.sort() if arr[0] + arr[1] <= arr[-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
#_______________________________________________________________# def fact(x): if x == 0: return 1 else: return x * fact(x-1) def lower_bound(li, num): #return 0 if all are greater or equal to answer = len(li)-1 start = 0 end = len(li)-1 while(start <= end): middle = (end+start)//2 if li[middle] >= num: ...
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, n) else: print(-1)
7
PYTHON3
t=int(input()) for _ in range(t): n=int(input()) arr=list(map(int,input().split())) s=arr[0]+arr[1] f=0 th=0 for i in range(2,n): if s > arr[i]: continue else: f=1 th=i if f==1: print("1 2",end=" ") print(th+1) else: ...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int size; cin >> size; std::vector<int> v(size); for (auto& x : v) cin >> x; if (v[0] + v[1] > v[size - 1]) cout << -1 << endl; else cout << 1 << " " << 2 << " " << size << endl; } ret...
7
CPP
t=int(input()) for _ in range(t): 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 sys import math input = sys.stdin.readline t = int(input()) for _ 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
t=int(input()) for i in range(t): n=int(input()) a=list(map(int,input().split())) if(a[n-1]>=a[0]+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())) mi = min(a) mii = a.index(mi) ma = max(a) mai = a.index(ma) fl = False i = -1 for i in range(len(a)): if i != mai and i != mii and mi + a[i] <= ma: fl = True break b...
7
PYTHON3
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): N = read_int() A = read_ints() # a+b < c if A[0]+A[1] <= A[-1]: return 1, 2, N return [-1] if __name__ == '__main__': T = read_int() for _ in range(...
7
PYTHON3
for _ in range(int(input())): x= int(input()) ar = list(map(int , input().split())) if ar[len(ar)-1]>=(ar[0]+ar[1]): print(f'1 2 {len(ar)}') else: print(-1)
7
PYTHON3
t = int(input()) for i in range(t): n = int(input()) lst1 = list(map(int,input().split())) a = max(lst1) b = 0 for i in range(1,n-1): if(lst1[0]+lst1[i] > a): continue else: b = 1 break if(b == 1): print(1,end = " ") print(i+1,e...
7
PYTHON3
T = int(input()) for t in range(T): n = int(input()) L = list(map(int, input().split())) if L[0] + L[1] <= L[-1]: print("1 2 {}".format(n)) else: print(-1)
7
PYTHON3
import sys 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()) for i in range(t): 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
def fun(l): sum=l[0]+l[1] for i in range(len(l)): if sum<=l[i]: return [1,2,i+1] return [-1] t=int(input()) for _ in range(t): n=int(input()) l=list(map(int,input().split())) ans=fun(l) print(*ans)
7
PYTHON3
for _ in range(int(input())): temp = input() arr = list(map(int, input().split())) arr.sort() if arr[0] + arr[1] <= arr[-1]: print("%d %d %d"% (1, 2, len(arr))) else: print("-1")
7
PYTHON3
t=int(input()) for _ in range(t): l=int(input()) flag=0 a=list(map(int,input().split(" "))) k=a[-1]-a[0] for i in range(1,l-1): if(a[i]<=k): print(1,i+1,l,end=" ") flag=1 print() break if(flag==0): print("-1")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int INF = 1e9 + 7; const int N = 1e5 + 5; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ; int t; cin >> t; while (t--) { int n; cin >> n; vector<long long int> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; ...
7
CPP
import collections from functools import lru_cache def read(): return input().strip() def readInt(): return int(input().strip()) def readList(): return list(map(int, input().strip().split())) def solve(N, arr): a, b, c = arr[0], arr[1], arr[-1] if a+b <= c: return " ".join(map(str,...
7
PYTHON3
from math import sqrt t = int(input()) def area(a, b, c): p = (a+b+c)/2 area = sqrt(p*(p-a)*(p-b)*(p-c)) return area while t: n = int(input()) a = [int(x) for x in input().split()] flag = 0 if a[0] + a[1] <= a[-1]: print(1, 2, n) else: print(-1) t -= 1
7
PYTHON3
#!/usr/bin/env python # https://github.com/cheran-senthil/PyRival/blob/master/templates/template_py3.py import os import sys,math from io import BytesIO, IOBase def main(): t=int(input()) for case in range(t): n=int(input()) l=list(map(int,input().split())) if l[0]+l[1]<=l[-1]: ...
7
PYTHON3
""" Satwik_Tiwari ;) . 14th AUGUST , 2020 - FRIDAY """ #=============================================================================================== #importing some useful libraries. from __future__ import division, print_function from fractions import Fraction import sys import os from io import BytesIO,...
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...
7
PYTHON3
def main(): 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) else: print(1, 2, n) main()
7
PYTHON3
T = int(input()) while T != 0: N = int(input()) A = list(map(int,input().strip().split()))[:N] found = False if A[0] + A[1] <= A[N - 1]: found = True if found: ans = [1,2,N] print(*ans) else: print(-1) T -= 1
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n); int a[n + 1]; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } if (a[0] + a[1] > a[n - 1]) { printf("-1\n"); continue; } else { printf("%d...
7
CPP
for _ in range(int(input())): n = int(input()) a = list(map(int, input().strip().split()))[:n] i = a[0] j1 = a[1] j2 = a[-2] k = a[-1] if(i + j1 <= k): print(1, 2, n) elif(i + j2 <= k): print(1, n-1, n) else: print(-1)
7
PYTHON3
t=int(input()) for _ in range(t): n=int(input()) L=[int(x) for x in input().split()] if (L[0]+L[1])<=L[-1]: print('1 2 '+str(n)) else: print(-1)
7
PYTHON3
tests = int(input()) for test in range(tests): 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 i in range(int(input())): n=int(input()) a=list(map(int,input().split())) k=0 if a[0]+a[1]<=max(a): print(1,2,n) else: print(-1)
7
PYTHON3
import sys import string import math from collections import defaultdict from functools import lru_cache from collections import Counter from fractions import Fraction def mi(s): return map(int, s.strip().split()) def lmi(s): return list(mi(s)) def tmi(s): return tuple(mi(s)) def mf(f, s): return ma...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const long long max_n = 1000000000; int main() { long long t; cin >> t; while (t--) { int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } sort(arr, arr + n); int a = arr[0]; int b = arr[1]; int c = arr[...
7
CPP
t=int(input()) for _ in range(t): n=int(input()) l=list(map(int,input().split())) m=l[0]+l[1] flag=False for i in range(2,n): if m<=l[i]: print(1,2,i+1) flag=True break if not flag: print(-1)
7
PYTHON3
try: t=int(input()) for i in range(t): n=int(input()) l=list(map(int,input().split())) a=l[0] b=l[1] v=2 for i in range(2,n): if(l[i]>=(a+b)): c=i+1 break else: v+=1 if(v==n): ...
7
PYTHON3
for _ in range(int(input())): n,a = int(input()), list(map(int, input().split())) if (a[0] + a[1] <= a[n-1]): print("1 2 {}".format(n)) else: print("-1")
7
PYTHON3
import itertools def testcases(a,n): #x,y,z=0,1,n-1 """for i in range(n-2): #z=n-1 for j in range(i+1,n-1): z=n-1 while(z>j): if a[i]+a[j]<a[z]: return i+1,j+1,z+1 else: z-=1 return -1""" if ...
7
PYTHON3
from collections import defaultdict as dd from sys import stdin,stdout for t in range(int(stdin.readline().strip())): 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
def func(): n = int(input()) a = list(map(int, input().split())) first = a[0] second = a[1] last = a[n-1] if(first + second <= last): return "1 2 " + str(n) else: return "-1" t = int(input()) for _ in range(t): print(func())
7
PYTHON3
t=int(input()) for hh in range(0,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
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) ans = -1 if a[0]+a[1] <= a[n-1]: ans = '1 2 ' + str(n) print(ans)
7
PYTHON3
def solve(): n=int(input()) a=list(map(int,input().split())) i,j=0,1 tmp = a[0]+a[1] for k in range(2,n): if a[k]>= tmp: print(i+1,j+1,k+1) return print(-1) for _ in range(int(input())): solve()
7
PYTHON3
for _ in range(0,int(input())): a=int(input()) b=list(map(int,input().split())) b.sort() if b[0]+b[1]>b[a-1] and b[1]-b[0]<b[a-1] and b[a-1]-b[1]<b[0] and b[a-1]-b[0]<b[1]: print("-1") else: print(1,2,a)
7
PYTHON3
for _ in range(int(input())): n = int(input()) arr = list(map(int,input().split())) ls = arr[0] + arr[1] if ls <= arr[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
import os #4 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: int(rdln()) inar=lambda: [int(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[1]>a[n-1]: ...
7
PYTHON3
t = int(input()) while t: n = int(input()) a = [int(i) for i in input().split()] if a[0] + a[1] <= a[len(a)-1]: print(1, 2, len(a)) else: print(-1) t -= 1
7
PYTHON3
for _ in range(int(input())): n=(int(input())) a=list(map(int,input().strip().split()))[:n] if(a[0]+a[1]<=a[-1]): print(1,2,n) else: print("-1")
7
PYTHON3
for z in range(int(input())): n=int(input()) flag=True a=[int(i) for i in input().split()] for i in range(n-2): if(a[i]+a[i+1]<=a[n-1]): flag=False print(i+1,i+2,n) break if flag==True: print("-1")
7
PYTHON3
from itertools import combinations def stdin(t): for _ in range(t): n = int(input()) a = [int(x) for x in input().split()] print(main(a, n)) def main(a, n): if a[n-1] >= a[0] + a[1]: return '{} {} {}'.format(1, 2, n) return -1 if __name__ == '__main__': stdin(int(in...
7
PYTHON3
for _ in range(int(input())): n = int(input()) l = list(map(int, input().split())) a = l[0] b = l[1] c = l[-1] if a+b <= c: print(1,2,n) 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
for _ in range(int(input())): n = input() array = list(map(int,input().split())) if array[0]+array[1]<=array[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
n = int(input()) for _ in range(n): m = int(input()) arr = list(map(int, input().split())) x = arr[0]+arr[1] flag = False for i in range(2, len(arr)): if x <= arr[i]: print(f"1 2 {i+1}") flag = True break if not flag: print("-1")
7
PYTHON3
import sys input=sys.stdin.readline for _ in range(int(input())): n=int(input()) #n,m=map(int,input().split()) #s=input().strip() a=list(map(int,input().split())) if a[0]+a[1]>a[-1]: print(-1) else: print(1,2,n)
7
PYTHON3
import sys #2 inp=sys.stdin.buffer.read().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[1]...
7
PYTHON3
for _ in range(int(input())): n=int(input()) s=list(map(int,input().split())) if s[0]+s[1]<=s[-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())) x=max(a) b=sorted(a) y=b[0] z=b[1] if y+z<=x: m=a.index(x) a[m]=0 k=a.index(y) a[k]=0 l=a.index(z) s=[m+1,k+1,l+1] print(*sorted(s)) else: print(-1)
7
PYTHON3
#from fractions import Fraction from collections import defaultdict from math import* import os import sys from io import BytesIO, IOBase from heapq import nlargest from bisect import* import copy import itertools BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = f...
7
PYTHON3
import os import 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[n - 1]: print(1, 2, n) else: print(-1) # FASTIO REGION BUFSIZE = 8192 class FastIO(IOB...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; int v[n]; for (int i = 0; i < n; i++) { cin >> v[i]; } if (v[0] + v[1] <= v[n - 1]) cout << 1 << " " << 2 << " " << n << endl; else cout << -1 << endl; } ret...
7
CPP
for _ in range(int(input())): n = int(input()) a = list(map(int,input().split())) flag = 0 min = a[0] + a[1] for i in range(2,len(a)): if min <= a[i]: print(1,2,i+1) flag = 1 break if flag == 0: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int MAXN = 501011; int a[MAXN]; int main() { int T; scanf("%d", &T); while (T--) { int n; scanf("%d", &n); for (int i = 1; i <= n; ++i) scanf("%d", &a[i]); if (a[1] + a[2] > a[n]) printf("-1\n"); else printf("1 2 %d\n", n); } ...
7
CPP
for _ in range(int(input())): a = int(input()) b = list(map(int,input().split())) if b[0]+b[1]>b[-1]: print(-1) else: print(1,2,a)
7
PYTHON3
import sys inp=sys.stdin.buffer.readline inin=lambda typ=int: typ(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
# code by RAJ BHAVSAR for _ in range(int(input())): n = int(input()) arr = list(map(int,input().split())) flag = 0 for i in range(1,n): t = arr[i] + arr[i-1] if(i != n-1): if(arr[n-1] >= t): flag = 1 print(i,i+1,n) break if(flag == 0): print(-1)
7
PYTHON3
t = int(input()) for z in range(t): n = int(input()) li = list(map(int,input().split())) first = li[0]+li[1] last = max(li) if last>=first: print(1,2,n) elif last<first: print(-1)
7
PYTHON3