solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
n = int(input()) for i in range(n): t = int(input()) l = input() i_l = [int(x) for x in l.split(" ")] if i_l[t-1] >= (i_l[0] + i_l[1]): print("1 2 " + str(t)) else: print("-1")
7
PYTHON3
for _ in range(int(input())): 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
ll = lambda: list(map(int, input().split())) lls=lambda: list(map(str, input().split())) st= lambda: input() v = lambda: map(int, input().split()) ii = lambda: int(input()) from math import * from sys import * from datetime import datetime from sys import stdin, stdout import sys def lcm(a,b): return (a*b)//gcd(a,b...
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
t = int(input()) for _ in range(t): n = int(input()) inp = [int(i) for i in input().split()] if inp[0]+inp[1] <= inp[n-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
def solve(n,arr): if arr[0] + arr[1] > arr[-1]: print("-1") else: print(f"1 2 {n}") t=int(input()) for i in range(t): n=int(input()) arr=list(map(int,input().split())) solve(n,arr)
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().strip().decode() _T_=inin() for _t_ in range(_T_): n=inin() a=inar() if a[0]+a[1]>a[n-1]: pr...
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]); if (a[0] + a[1] <= a[n - 1]) printf("1 2 %lld\n", n); else printf("-1\n"); } ret...
7
CPP
def solve(): N = int(input()) A = list(map(int, input().split())) if A[0] + A[1] <= A[-1]: return '{} {} {}'.format(1, 2, N) return '-1' TC = int(input()) for _ in range(TC): print(solve())
7
PYTHON3
for _ in range(int(input())): i,a=int(input()),list(map(int,input().split())) [print('1 2 {}'.format(str(i)) if a[0]+a[1]<=a[i-1] else '-1')]
7
PYTHON3
from bisect import * T = int(input()) for i in range(T): N = int(input()) A = list(map(int, input().split())) for i in range(N-2): if A[i]+A[i+1]>A[-1]: continue ind = bisect_left(A,A[i]+A[i+1])+1 print(i+1,i+2,ind) break else: print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) f = False s = a[0] + a[1] if s <= a[-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
import math for _ in range(int(input())): n = int(input()) arr = list(map(int, input().split())) a,b = arr[0], arr[1] c = -1 for i in range(2, n): if(arr[i]>= a+b): c = i+1 break if(c!= -1): print(1,2,c) else: print(-1)
7
PYTHON3
def answ(): x=int(input()) s=list(map(int,input().split())) a=s[0] b=s[1] for n in range(x-1,1,-1): c=s[n] if a+b<=c or a+c<=b or b+c<=a: print(1,2,n+1) return b=s[-1] for n in range(x-2,0,-1): c=s[n] if a+b<=c or a+c<=b or b+c<=a: print(1,n+1,x) return print(-1) for i in range(int(input(...
7
PYTHON3
def do(): n = int(input()) dat = list(map(int, input().split())) dat.sort() a = dat[0] + dat[1] for i in range(2, n): if dat[i] >= a: print(1,2, i+1) return print(-1) q = int(input()) import bisect for _ in range(q): do()
7
PYTHON3
l=[] for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) if a[0]+a[1]>a[-1]: l.append(-1) else: l.append(f"{1} {2} {len(a)}") for i in l: print(i)
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int,input().split())) flag = 0 if(a[0]+a[1]<=a[-1]): print(1,2,n) else: print(-1)
7
PYTHON3
def fun(arr,N): l=[1,2,N] #print("sum of 1 and 2 elem: {}".format(arr[0]+arr[1])) #print("value of N-1: {}".format(arr[N-1])) if(arr[0]+arr[1]>arr[N-1]): l1=[-1] return l1 else: return l out=[] test=int(input()) for x in range(test): N=int(input()) arr=list(map(int,input().split())) out.append(fun(arr,...
7
PYTHON3
from random import randint t = int(input()) for _ in range(t): n = int(input()) arr = [int(j) for j in 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; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const long long maxn = 3e6; const long long mod = 1e9 + 7; const long double PI = acos((long double)-1); long long pw(long long a, long long b, long long md = mod) { long long res = 1; while (b) { ...
7
CPP
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
# -*- coding: utf-8 -*- """ Created on Fri Aug 14 20:27:10 2020 @author: Dark Soul """ t=int(input('')) arr=[] for i in range(t): int(input('')) arr.append(list(map(int,input().split()))) for i in arr: n=len(i) s=i[0]+i[1] flag=0 for j in range(2,n): if i[j]>=s: print(1,2,j...
7
PYTHON3
from collections import defaultdict as dd import sys input=sys.stdin.readline t=int(input()) while t: n=int(input()) #n,m=map(int,input().split()) l=list(map(int,input().split())) lol=0 if(l[0]+l[1]<=l[-1]): print(1,2,n) lol=1 if(lol==0): print(-1) t-=1
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,n) else: print("-1")
7
PYTHON3
t = int(input()) while t: n = int(input()) a = list(map(int, input().split())) if a[0] + a[1] <= a[-1]: print("1 2 {}".format(n)) else: print(-1) t -= 1
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long int t, i, j, a, n; cin >> t; while (t--) { cin >> n; long long int a[n + 5], f = 0; for (i = 0; i < n; i++) cin >> a[i]; for (i = 0; i < n - 2; i++) { if (a[i...
7
CPP
# for _ in range(int(input())): # s = input() # z = [] # c = 0 # for i in range(len(s)): # if s[i]=="1": # c+=1 # else: # if c: # z.append(c) # c=0 # if c: # z.append(c) # z.sort(reverse=True) # su = 0 # if z: # ...
7
PYTHON3
for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) print(*([1,2,n],[-1])[a[0]+a[1]>a[n-1]])
7
PYTHON3
t=int(input("")) while t>0: n=int(input("")) a=list(map(int,input().split())) if(a[0]+a[1]<=a[-1]): print(1,2,n) elif(a[0]<=(a[-1]-a[-2])): print(1,n,n-1) else: print(-1) t-=1
7
PYTHON3
Q=int(input()) for q in range(Q): N=int(input()) L=list(map(int,input().split())) L.sort() if L[-1]>=(L[0]+L[1]): print(1,2,N) else: print(-1)
7
PYTHON3
for j in range(int(input())): n=int(input()) l=list(map(int,input().split())) if len(l)==3: if l[0]+l[1]<=l[2]: print(1,2,3) else: print(-1) else: x=0 for i in range(len(l)-2): if l[i]+l[i+1]<=l[-1]: print(i+1,i+2,len(l...
7
PYTHON3
for i in range(int(input())): numLen = int(input()) nums = input() nums = list(map(int, nums.split())) numLen = len(nums) # more reliable than usr input if numLen < 3: # prevent hacking print(-1) continue answer = False for x in range(numLen): if x == numLen-1: break a = nums[x] b = nums[x+1] c = num...
7
PYTHON3
n = int(input().strip()) printing = [] for test in range(n): m = input() a = input().strip().split(" ") b= [] for c in a: b.append(int(c)) b.sort() if int(b[0]) + int(b[1]) <= int(b[-1]): d = [] d.append(a.index(str(b[0]))+1) d.append(a...
7
PYTHON3
for i 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
t = int(input()) def solve(n, a): if a[0] + a[1] <= a[-1]: print(1, 2, n) return else: print(-1) return for _ in range(t): n = int(input()) a = list(map(int, input().split())) solve(n, a)
7
PYTHON3
t=int(input()) for _ in range(t): flag=0 n=int(input()) inp=list(map(int,input().split())) if inp[0]+inp[1]<=inp[-1]: print (1,end=" ") print (2,end=" ") print (len(inp)) continue else: print (-1)
7
PYTHON3
import sys input=sys.stdin.buffer.readline inin=lambda: int(input()) inar=lambda: list(map(int,input().split())) inst=lambda: input().decode().rstrip('\n\r') INF=float('inf') #from collections import deque as que, defaultdict as vector, Counter #from bisect import bisect as bsearch #from heapq import heapify, heappush ...
7
PYTHON3
### START FAST IO ### import os os_input = os.read(0, int(1e7)).split() os_input_pos = -1 answer_list = [] def read_s(): global os_input_pos os_input_pos += 1 return os_input[os_input_pos].decode() def read_i(): return int(read_s()) def write_s(v): answer_list.append(v) def write_i(v): write_s(str(v)) def p...
7
PYTHON3
#Consistency is the key. #code by: amrit00 from sys import stdin,stdout import math input=stdin.readline def print(*args,end='\n'): s=[] for i in args: s.append(str(i)+' ') s=''.join(s) stdout.write(s+end) def solve(): n=int(input()) l=list(map(int,input().split())) if l[0]+l[...
7
PYTHON3
t = int(input()) while t: t -= 1 n = int(input()) arr = list(map(int,input().split())) i = 0 # for i in range(n-2): if arr[i]+arr[i+1]<= arr[n-1]: print(i+1,i+2,n) else: print(-1)
7
PYTHON3
def solve(): n=int(input()) arr=[int(i) for i in input().split()] arr.sort() if(arr[0]+arr[1]<=arr[-1]): print(1,2,n) return print(-1) test=int(input()) while test: solve() test-=1
7
PYTHON3
for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) mi, mi_idx, ma, ma_idx = 10**10, 0, 0, 0 for i in range(n): if a[i] < mi: mi, mi_idx = a[i], i if a[i] > ma: ma, ma_idx = a[i], i ans = [mi_idx+1, ma_idx+1] for i in range(n...
7
PYTHON3
for _ in range(int(input())): n = int(input()) x = list(map(int, input().split())) if x[0] + x[1] <= x[-1]: print(1, 2, n) else: print(-1)
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()) for _ in range(t): n=int(input()) a=list(map(int,input().split(" "))) chk=0 for x in range(n-2): if a[x]+a[x+1]<=a[n-1]: print(x+1,x+2,n) chk=1 break; if chk==0: print(-1)
7
PYTHON3
import math for i in range(int(input())): n = int(input()) ar = list(map(int,input().split())) if ar[0] + ar[1] <= ar[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
t=int(input()) while(t>0): n=int(input()) a=list(map(int,input().split())) s=a[0]+a[1] ans=-1 for i in range(2,n): if(a[i]>=s): ans=i else: continue if(ans!=-1): print("1 2 "+str(ans+1)) else: print(ans) t-=1
7
PYTHON3
import sys def input(): return sys.stdin.readline().strip() def iinput(): return int(input()) def rinput(): return map(int, sys.stdin.readline().strip().split()) def get_list(): return list(map(int, sys.stdin.readline().strip().split())) mod = int(1e9)+7 def checkValidity(a, b, c): if (a + b <= c) or ...
7
PYTHON3
import sys input = sys.stdin.readline ins = lambda: input().rstrip() ini = lambda: int(input().rstrip()) inm = lambda: map(int, input().split()) inl = lambda: list(map(int, input().split())) ans = [] t = ini() for _ in range(t): n = ini() a = inl() if a[0] + a[1] <= a[n-1]: ans.append(f"{1} {2} {n}...
7
PYTHON3
t=int(input()) while t: t-=1 n=int(input()) lst=list(map(int,input().split())) res=-1 a=lst[0] b=lst[1] if n==3: if a+b<=lst[2]: res=3 else: for i in range(2,n): if a+b<=lst[i]: res=i+1 break if res==-1: ...
7
PYTHON3
for i in range(int(input())): n=int(input()) l=list(map(int,input().split())) if (l[0]+l[1]<=l[len(l)-1]): print(1,2,len(l)) else: print(-1)
7
PYTHON3
# [int(s) for s in input().split()] # int(input()) # input() T = int(input()) for t in range(1,T+1): N = int(input()) A = [int(s) for s in 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(void) { int n; cin >> n; while (n--) { int t; cin >> t; map<int, int> mp; int a[t], b[3]; for (int i = 0; i < t; i++) { cin >> a[i]; mp[a[i]] = i + 1; } sort(b, b + 3); if (a[0] + a[1] > a[t - 1]) { cout << -1...
7
CPP
def solve(n, a): a, b, c = a[0], a[1], a[-1] if a + b > c: print(-1) else: print(1, 2, n) return def main(): inp = lambda: [int(x) for x in input().split()] tc = int(input()) for _ in range(tc): n, a = int(input()), inp() solve(n, a) if __name__ == '__main__...
7
PYTHON3
def no_triangle(arr): arr.sort() if arr[0]+arr[1]<=arr[-1]: l = [1,2,len(arr)] else: l = [] return l t = int(input()) for _ in range(t): n = int(input()) arr = list(map(int,input().split())) result = no_triangle(arr) if result: print(*result,sep=" ") else...
7
PYTHON3
test=int(input()) for _ in range(test): n=int(input()) list1=list(map(int,input().split())) if list1[0]+list1[1]<=list1[n-1]: print(1,2,n) else: print("-1")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, flag1 = 0, flag2 = 0; 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...
7
CPP
# cook your dish here t = int(input()) while t>0: n = int(input()) a = list(map(int, input().split())) if a[0] + a[1] <= a[n-1]: print("1 2 ",n) else: print("-1") t = t-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,n) else : print(-1)
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) v = [int(x) for x in input().split()] if v[0] + v[1] <= v[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; struct HASH { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t ...
7
CPP
#!/usr/bin/env python3 import io import os import sys input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline def prdbg(*args, **kwargs): print(*args, **kwargs) pass def get_str(): return input().decode().strip() def rint(): return map(int, input().split()) def oint(): return int(input()) ...
7
PYTHON3
for j in range(int(input())): a = int(input()) li = list(map(int,input().split())) ma = li[a-1] mi = li[0] val = ma - mi for j in range(1,a): if li[j] <=val: mid = j print(1,j+1,a) break else: ...
7
PYTHON3
# 2200 rating t=int(input()) for i in range(t): n=input() l=list(map(int,input().split())) # print(l) if l[0]+l[1]<=l[-1]: print(1,2,n) else: print(-1)
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, 2, n) else: print(-1)
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int,input().split())) flag = 0 for i in range(2,n): if(a[0]+a[1]<=a[i]): print(1,2,i+1) flag = 1 break if (flag==0): print(-1)
7
PYTHON3
import sys input = sys.stdin.readline t = int(input()) for i in range(t): n = int(input()) A = list(map(int,input().split())) if A[0] + A[1] <= A[-1]: print("{} {} {}".format(1,2,n)) else: print(-1)
7
PYTHON3
t = int(input()) for i in range(t): n = int(input()) mas = list(map(int, input().split())) if (len(mas) < 3): print(-1) else: if (mas[0]+mas[1] > mas[-1]): print(-1) else: print(1,2,len(mas))
7
PYTHON3
def triangle(a,b,c): if a+b>c and b+c>a and a+c>b: return True else: return False for _ in range(int(input())): a = int(input()) b = list(int(x) for x in input().split()) if triangle(b[0],b[1],b[-1])==False: print(1,2,a) 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[50001]; for (int i = 0; i < n; i++) cin >> a[i]; if (a[0] + a[1] > a[n - 1]) { cout << -1 << endl; } else { cout << 1 << " " << 2 << " " << n << endl; } } re...
7
CPP
t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,input().split())) a.sort() 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()) l=list(map(int,input().split())) for i in range(2,len(l)): if l[0]+l[1]<=l[i]: print(1,2,i+1) break else: print(-1)
7
PYTHON3
for _ in range(int(input())): n=int(input()) l=list(map(int,input().split())) c=l[n-1] ok=False p,q,r=0,0,0 for i in range(1,n-1): if l[i]+l[i-1]<= c: p,q=i,i-1 ok=True if(ok): print(q+1,p+1,n) else: print("-1")
7
PYTHON3
def solve(a): if a[0] + a[1] <= a[-1]: return 1, 2, len(a) return [-1] for _ in range(int(input())): n = int(input()) a = [int(x) for x in input().split()] print(*solve(a))
7
PYTHON3
#import sys #input = sys.stdin.readline def solve(): n = int( input()) A = list( map( int, input().split())) if A[0] + A[1] <= A[-1]: return " ".join( map( str, [1,2,n])) else: return -1 def main(): t = int( input()) ANS = [ solve() for _ in range(t)] print("\n".join( map(st...
7
PYTHON3
for _ in range(int(input())): n=int(input()) a=[int(i) for i in 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()) l1 = [int(x) for x in input().split()] flag = 0 if l1[0]+l1[1]<=l1[-1]: flag = 1 if flag: print(1,2,n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> #pragma GCC optimizer("O3") #pragma GCC target("sse4") using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { long long int n; cin >> n; vector<long long int> a(n); for (long long int i = 0; i < n; i++)...
7
CPP
t = int(input().split()[0]) for case in range(t): n = int(input().split()[0]) 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 i in range(t): n=int(input()) list1=list(map(int,input().split())) for i in range(n-1): j=i+1 if (list1[i]+list1[j])>list1[n-1]: print(-1) break else: print(i+1,j+1,n) break
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int32_t main() { 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]; } vector<long long> ans; long long temp = arr[n - 1] - arr[0]; long long i = 0; ...
7
CPP
import sys 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]>a[...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t, n, val; vector<int> v; cin >> t; for (int i = 0; i < t; i++) { cin >> n; for (int j = 0; j < n; j++) { cin >> val; v.push_back(val); } if (v[0] + v[1] > v[n - 1]) { cout << -1 << endl; } else { cout << ...
7
CPP
test_case = int(input()) for _ in range(test_case): 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())): i_liczb = int(input()) liczby = list(map(int, input().split())) a, b, c = liczby[0], liczby[1], liczby[-1] if a + b <= c: print(1, 2, i_liczb) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; vector<vector<int>> v(t); int n; int temp; for (int i = 0; i < t; i++) { cin >> n; v[i].reserve(n); for (int j = 0; j < n; j++) { cin >> temp; v[i].push_back(temp); } } for (int i = 0; i < t; i++) { ...
7
CPP
t = int(input()) while(t>0): n = int(input()) arr = list(map(int, input().split())) if(arr[0]+arr[1]>arr[n-1]): print(-1) else: print(1, 2, n) t-=1
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long int n; cin >> n; long long int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; if (a[0] + a[1] > a[n - 1]) cout << -1 << endl; else cout << 1 << " " << 2 << " " << n << endl; } ...
7
CPP
#include <bits/stdc++.h> using namespace std; void solve(bool& flag) { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } if (n < 3) { return; } else { if (a[0] + a[1] <= a[n - 1]) { cout << 1 << " " << 2 << " " << n << endl; flag = true; } } } in...
7
CPP
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int,input().split(' '))) i,j,k = 0,1,2 while i < n-2: while j < n-1 : while k < n: if a[i] + a[j] <= a[k]: print(i+1,j+1,k+1) i,j,k = n,n,n break else: k += 1 j += 1 i += 1 if i == n-2 and j == n - 1 and ...
7
PYTHON3
#!/usr/bin/env python import os import re import sys from bisect import bisect, bisect_left, insort, insort_left from collections import Counter, defaultdict, deque from copy import deepcopy from decimal import Decimal from fractions import gcd from io import BytesIO, IOBase from itertools import ( accumulate, comb...
7
PYTHON3
t=int(input()) dict={} for i in range(t): a=input() b=input().split(" ") m=len(b) for i in range(m): if int(b[0])+int(b[1])>int(b[m-1]): print(-1) break else: print(1,2,m) break
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) a=[int(v) for v in input().split()] p=a[0] q=a[1] r=a[-1] if p+q<=r: 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())) print("-1" if arr[0]+arr[1]>arr[n-1] else f"1 2 {n}")
7
PYTHON3
def tc(): n = int(input()) a = list(map(int, input().split())) if a[0] + a[1] > a[-1]: print(-1) else: print(1, 2, n) ################# T = int(input()) for _ in range(T): tc()
7
PYTHON3
for time in range(int(input())): l=int(input()) op=[] rt=input().split() op=rt for er in range(l): op[er]=int(op[er]) x=op[0] y=op[1] z=op[-1] if z>=x+y: print(1,2,l) else: print(-1)
7
PYTHON3
T=int(input()) for t in range(T): n=int(input()) l=[int(k) for k in input().split()] i=0 j=1 k=2 f=0 for m in range(2,n): if(l[i]+l[j]<=l[m]): k=m f=1 break if(f==1): print(i+1,j+1,k+1) else: print(-1)
7
PYTHON3
import io,os from collections import deque import bisect from collections import deque #input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline RL = lambda : list(map(int, input().split(' '))) T = int(input()) for _ in range(T): n = int(input()) l = RL() if l[0]+l[1]<=l[-1]: print(1,2,n) els...
7
PYTHON3
import sys # 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
t = int(input()) for i in range(t): a = [-1] n=int(input()) arr = list(map(int,input().split())) for j in range(2,n): if arr[0]+arr[1]<=arr[j]: a=[1,2,j+1] for item in a: print(item, end=" ")
7
PYTHON3