solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
Test = int(input()) for i in range(Test): length = int(input()) array = list(map(int,input().split())) if array[-1] >= array[0] + array[1] : print(1,2,length) else : print(-1)
7
PYTHON3
# Pratyaydeep import sys inp=sys.stdin.buffer.read().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[...
7
PYTHON3
for s in range(int(input())): n=int(input()) a=list(map(int,input().split())) add=a[0]+a[1] flag=0 for i in range(2,n): if(a[i]>=add): flag=-1 break if(flag==0): print(-1) else: print(1,2,i+1)
7
PYTHON3
for test_i in range(int(input())): n = int(input()) arr = list(map(int, input().split())) max_el, min_el1 = max(arr), min(arr) max_eli, min_el1i = arr.index(max_el), arr.index(min_el1) arr[min_el1i] = max_el + 1 min_el2 = min(arr) min_el2i = arr.index(min_el2) ans = [max_eli + 1, min_el1...
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,len(s)) else: print(-1)
7
PYTHON3
def main(): for _ in range(int(input())): n=int(input()) A=[int(e) for e in input().split()] i=0 j=1 k=n-1 # while k>j: if A[i]+A[j]<=A[k]: print(i+1,j+1,k+1) else: print(-1) main()
7
PYTHON3
t = int(input()) for i in range(t): n = int(input()) a = list(map(int, input().split())) if a[0] + a[1] <= a[n - 1]: print(f'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[-1]+a[0]<=a[1] or a[-1]+a[1]<=a[0] or a[0]+a[1]<=a[-1]): print(1,2,n) else: print("-1")
7
PYTHON3
n = int(input()) for i in range(n): num_arr = int(input()) arr = input().split(" ") if (len(arr) < 3): print("-1") continue if (int(arr[0]) + int(arr[1]) <= int(arr[-1])): print("1 2 " + str(len(arr))) else: print("-1")
7
PYTHON3
for i in range(int(input())): a=int(input()) b=list(map(int,input().split())) c=b[0]+b[1] d=True for j in range(2,a): if b[j]>=c: d=False break if d==False: print(1,2,j+1) else: print(-1)
7
PYTHON3
t = int(input()) for i in range(0,t): n = int(input()) arr = input().split(" ") if int(arr[0]) + int(arr[1]) <= int(arr[len(arr)-1]): print("1 2 "+str(len(arr))) else: print("-1")
7
PYTHON3
for i in range(int(input())): n=int(input()) a=list(map(int,input().split())) i=a[0] j=a[1] flag=0 for k in range(len(a)-1,-1,-1): if i+j<=a[k]: print(1,end=" ") print(2,end=" ") print(k+1) flag=1 break if flag==0: p...
7
PYTHON3
for _ in range(int(input())): n=int(input()) f=0 a=list(map(int,input().split())) for i in range(n-2): if a[i]+a[i+1]<=a[-1]: print(i+1,i+2,n) f=1 break if f==0: print("-1")
7
PYTHON3
# -*- coding: utf-8 -*- """ Created on Fri Aug 14 09:48:33 2020 @author: Tuong """ t = int(input()) for m in range(t): n = int(input()) a_n = [int(i) for i in input().split()] if a_n[0] + a_n[1] <= a_n[-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void solve() { long long int n; cin >> n; vector<long long int> a(n); for (auto &x : a) cin >> x; long long int p = -1, q = -1, r = -1; long long int big = a[n - 1]; bool ok = false; for (int i = n - 2; i >= 0; i--) { if (a[i] + a[i - 1] <= big && i - 1 ...
7
CPP
import sys, os, io def rs(): return sys.stdin.readline().rstrip() def ri(): return int(sys.stdin.readline()) def ria(): return list(map(int, sys.stdin.readline().split())) def ws(s): sys.stdout.write(s + '\n') def wi(n): sys.stdout.write(str(n) + '\n') def wia(a): sys.stdout.write(' '.join([str(x) for x in a]) + '\n') ...
7
PYTHON3
import sys inp=sys.stdin.buffer.readline inin=lambda : int(inp()) inar=lambda : list(map(int,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 i in range(int(input())): n=int(input()) a=sorted(map(int,input().split())) print("1 2 %d" % n if(a[0]+a[1]<=a[n-1]) else -1)
7
PYTHON3
t = int(input()) for tt in range(t): n = int(input()) a = [int(x) for x in input().split()] ok = True res = (0,0,0) i = 0 while i+1 < n-1-i: if a[i] + a[i+1] <= a[n-1-i]: ok = False res = (i+1, i+2, n-1-i+1) if i < n-2-i: if a[n-1-i] >= a[i] + ...
7
PYTHON3
#------------------------template--------------------------# import os import sys from math import * from collections import * from fractions import * from bisect import * from heapq import* from io import BytesIO, IOBase def vsInput(): sys.stdin = open('input.txt', 'r') sys.stdout = open('output.txt', 'w') BUF...
7
PYTHON3
for _ in range(int(input())): n = int(input()) list1 = [int(i) for i in input().split()] try: if list1[0]+list1[1]<=list1[-1]: print(1,2,n) else: print(-1) except: print(-1)
7
PYTHON3
# cook your dish here # code # ___________________________________ # | | # | | # | _, _ _ ,_ | # | .-'` / \'-'/ \ `'-. | # | / | | | | \ | # | ; \_ _/ \_ _/ ; ...
7
PYTHON3
for I in range(int(input())): n = int(input()) a = list(map(int,input().split())) temp = a[0]+a[1] res = -1 for i in range(2,n): if a[i]>=temp: res = i+1 break if res==-1: print(res) else: print(1,2,res)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void test() { long long n; cin >> n; vector<long long> v; for (long long i = 0; i < n; i++) { long long num; cin >> num; v.push_back(num); } if (v[0] + v[1] <= v[n - 1]) { cout << 1 << " " << 2 << " " << n << endl; } else { cout << -1 << en...
7
CPP
for _ in range(int(input())): r=int(input())-1 k=input().split() if int(k[0])+int(k[1])>int(k[r]): print(-1) else: print("1","2",str(r+1))
7
PYTHON3
T = int(input()) for _ in range(T): N = int(input()) A = list(map(int, input().split())) a_i = A[0] a_j = A[1] ans = 0 for k in range(2, N): if A[k] >= a_i + a_j: ans = k break if ans == 0: print(-1) else: print(1, 2, k+1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) lst = list(map(int, input().split())) if lst[0]+lst[1] <= lst[n-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int64_t cases, total, elements, i; cin >> cases; for (i = 0; i < cases; i++) { int flag = 0, val = 0; vector<int> x = {}; cin >> total; for (int j = 0; j < total; j++) { cin >> elements; x.push_back(elements); } for (in...
7
CPP
for _ in range(int(input())): n=int(input()) l=list(map(int,input().split())) t=l[0]+l[1] flag=0 for i in range(2,n): if l[i]>=t: flag=1 c=i break if flag: print(1,2,c+1) else: print(-1) # flag=0 # for i in range(n-2): ...
7
PYTHON3
""" Author: Q.E.D Time: 2020-08-14 09:36:04 """ 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
# cook your dish here for _ in range(int(input())): n=int(input()) v=list(map(int,input().split())) flag=0 if len(v)<3: print(-1) else: a=v[0] b=v[1] summ=a+b flag=0 for i in range(2,len(v)): if v[i]>=summ: print(1,...
7
PYTHON3
import sys import math,bisect from collections import defaultdict from itertools import groupby,accumulate from heapq import heapify,heappop,heappush from collections import deque,Counter,OrderedDict #input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__ def neo(): return map(int,input().split()) def Neo...
7
PYTHON3
import sys #another two 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 _ in range(t): n = int(input()) a, b, *_, c = map(int, input().split()) if a + b <= c: print(1, 2, n) else: print(-1)
7
PYTHON3
from math import * from copy import * from string import * # alpha = ascii_lowercase from random import * from sys import stdin,stdout from sys import maxsize from operator import * # d = sorted(d.items(), key=itemgetter(1)) from itertools import * from collections import Counter # d = dict(Counter(l)) import ma...
7
PYTHON3
''' Auther: ghoshashis545 Ashis Ghosh College: jalpaiguri Govt Enggineering College ''' from os import path import sys from functools import cmp_to_key as ctk from collections import deque,defaultdict as dd from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right from itertools impor...
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") else: print(str("1")+" "+str("2")+" "+str(n))
7
PYTHON3
tests = int(input()) for t in range(tests): n = int(input()) ls = list(map(int, input().split())) if ls[0] + ls[1] <= ls[-1]: print(f"1 2 {n}") else: print(-1)
7
PYTHON3
t=int(input()) for _ in range(t): n=int(input()) l=list(map(int,input().split())) x,y,z=l[0],l[-1],l[1] if y>=x+z: print(1,2,n) else: print(-1)
7
PYTHON3
for _ in [0]*int(input()): n = int(input()) arr=[int(a) for a in input().split()] if (arr[0]+arr[1] <= arr[-1]): print(1,2,n) else: print(-1)
7
PYTHON3
import os #3 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()) for test in range(t): n = int(input()) nums = [int(x) for x in input().split()] first = nums[0]+nums[1] if first <= nums[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
import copy for ii in range(int(input())): n=int(input()) a=list(map(int , input().split())) b=copy.deepcopy(a) b.sort() x=b[0] y=b[1] z=b[n-1] if x+y<=z: print(1,2,n) else: print(-1)
7
PYTHON3
for _ in range(int(input())): t = 1 n = int(input()) a = list(map(int, input().split())) for k in range(2, n): if (a[k] >= a[0] + a[1]) and t: t = 0 print(1, 2, k + 1) break if t: print(-1)
7
PYTHON3
import sys input = sys.stdin.readline t = int(input()) for _ in range(t): n = int(input()) nList = list(map(int, input().split())) if nList[0]+nList[1] > nList[-1]: print(-1) else: print(1, 2, n)
7
PYTHON3
for _ in range(int(input())): N = int(input()) A = list(map(int, input().split())) A = [[A[i], i + 1] for i in range(N)] A.sort() if A[0][0] + A[1][0] <= A[-1][0]: ans = [A[0][1], A[1][1], A[-1][1]] else: ans = [-1] ...
7
PYTHON3
for i in range(int(input())): n = int(input()) a = list(map(int,input().split())) print("1 2 "+str(n) if len(a) >= 3 and a[0]+a[1] <= a[n-1] else -1)
7
PYTHON3
for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) c=0 if a[0]+a[1]<=a[-1]: print(1,2,n) c=1 if c==0: print(-1)
7
PYTHON3
t=int(input()) for i in range(0,t): n=int(input()) f=0 a=list(map(int,input().split())) summ=a[0]+a[1] for j in range(2,len(a)): if summ<=a[j]: f=j break if f==0: print(-1) elif f!=0: print(1,end=' ') print(2,end=' ') print(f+1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void showlist(list<long long int> g) { list<long long int>::iterator it; for (it = g.begin(); it != g.end(); ++it) cout << *it << " "; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long int t; cin >> t; while (t--) { long lon...
7
CPP
from sys import stdin, stdout def main(): t = int(input()) for _ in range(t): n = int(input()) arr = list(map(int, stdin.readline().split())) if arr[n - 1] >= arr[0] + arr[1]: print(1, 2, n) else: print(-1) main()
7
PYTHON3
from sys import stdin,stdout from math import sqrt,gcd,ceil,floor,log2,log10,factorial,cos,acos,tan,atan,atan2,sin,asin,radians,degrees,hypot from bisect import insort, insort_left, insort_right, bisect_left, bisect_right, bisect from array import array from functools import reduce from itertools import combinations, c...
7
PYTHON3
def A(arr): if arr[0] + arr[1] <= arr[len(arr)-1]: print(1, 2, len(arr)) else: print(-1) count = int(input()) for i in range(count): lne = int(input()) arr = list(map(int, input().split())) A(arr)
7
PYTHON3
import math T = int(input()) lets = 'abcdefghijklmnopqrstuvwxyz' key = {lets[i]:i for i in range(26)} for i in range(T): n = int(input()) #n,m = map(int, input().split()) #a = input() a = list(map(int,input().split())) d = False 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())) result = False for i in range(n-1): if arr[i]+arr[i+1]<=arr[n-1]: print(i+1,i+2,n) result = True break if result == False: print(-1)
7
PYTHON3
for _ in range(int(input())): n=int(input()) l=list(map(int,input().strip().split()[:n])) if l[0]+l[1]>l[n-1]: print(-1) else:print(1,2,n)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { long long t, n, i, j, k, x, flag; long long* a; cin >> t; while (t--) { cin >> n; a = new long long[n]; for (i = 0; i < n; i++) { cin >> a[i]; } if (a[0] + a[1] <= a[n - 1]) { cout << "1 2 " << n << "\n"; } else { ...
7
CPP
for t in range(int(input())): b=int(input()) a=[int(x) for x in input().split()] flag=0 if(a[0]+a[1]<=a[-1]): print(1,2,b) else: print('-1')
7
PYTHON3
for _ in range(int(input())): n=int(input()) l=list(map(int,input().split())) def bin_search(data, target): # order of log(n) # works only on sorted list low = 0 high = len(data) - 1 while low <= high: mid = (low + high) // 2 if data[mid] >= target: ...
7
PYTHON3
t=int(input()) for tc 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
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) ok = False for i in range(1, n-1): if a[i-1]+a[i] <= a[-1]: print(i, i+1, n) ok = True break if not ok: print(-1)
7
PYTHON3
t=int(input()) for q in range(t): n=int(input()) ch=input() L=[int(i)for i in ch.split()] 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 = list(map(int, input().split())) if a[-1] >= a[0] + a[1]: print(f'1 2 {len(a)}') else: print('-1')
7
PYTHON3
t=int(input()) for x in range(t): n=int(input()) a=list(map(int,input().split())) count=0 if a[0]+a[1]<=a[-1]: print('1','2',n) else: print('-1')
7
PYTHON3
import sys input = sys.stdin.readline T = int(input()) for t in range(T): N = int(input()) A = [int(_) for _ 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()) 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
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) """ 3 7 4 6 11 11 15 18 20 4 10 10 10 11 3 1 1 1000000000 --------------- 2 3 6 -1 1 2 3 """
7
PYTHON3
def degenerate(a,n): a = sorted(a) if a[0]+a[1] <= a[-1]: print(1,2,n) else: print(-1) t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) degenerate(a,n)
7
PYTHON3
import sys stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().rstrip() # ignore trailing spaces t = ni() for _ in range(t): n = ni() ar = [int(x) for x in input().split()] if (ar[0] + ar[1] <= ar[-1]): print("1 2 "+str(n...
7
PYTHON3
import os inp=os.read(0,os.fstat(0).st_size).split(b"\n");_ii=-1 _DEBUG=0 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
for i in range(int(input())): n=int(input()) l=list(map(int,input().split())) p=max(l) i1=l.index(p) m1=min(l) i2=l.index(m1) l[i2]=p m2=min(l) i3=l.index(m2) if(m1+m2 <= p): i1+=1 i2+=1 i3+=1 l1=[] l1.append(i1) l1.append(i2) ...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t) { int n; cin >> n; vector<int> vec; int flag = 1; for (int j = 0; j < n; j++) { int x; cin >> x; vec.push_back(x); } for (int i = 2; i < n; i++) { if (vec[0] + vec[1] <= vec[i]...
7
CPP
def solve(arr,n): if(arr[-1]>=arr[0]+arr[1]): print(1,2,n) return print(-1) t = int(input()) for _ in range(t): n = int(input()) arr = list(map(int,input().split())) solve(arr,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) else: print(1,2,n)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while (T--) { int n; cin >> n; vector<pair<int, int> > A(n); for (int i = 0; i < n; i++) { cin >> A[i].first; A[i].second = i + 1; } sort(A.begin(), A.end()); if (A[0].first + A[1].first <= A[n - 1]...
7
CPP
for z in range(int(input())): n=int(input()) flag = 1 a=[int(i) for i in input().split()] for i in range(n-2): if(a[i]+a[i+1]<=a[n-1]): flag=0 print(i+1,i+2,n) break if flag==1: print("-1")
7
PYTHON3
for _ in range(int(input())): n = int(input()) a = [int(i) for i in input().split()] minimum = min(a) ind = a.index(minimum) nexus = a[ind] a[ind] = -1 maximum = max(a) a[ind] = float('inf') minimum2 = min(a) ind2 = a.index(minimum2) ind3 = a.index(maximum) a[ind] = nexus...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { 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 { cout << 1 << " " << 2 << " " << n << endl; ...
7
CPP
from sys import stdin t=int(input()) for T in range(t) : n=int(input()) arr=[int(x) for x in stdin.readline().split()] flag=0 for i in range(n-2) : for k in range(2,n) : if arr[i]+arr[i+1]<=arr[k] : print(i+1,i+2,k+1) flag=1 break ...
7
PYTHON3
#1398A for i in range(int(input())): n=int(input()) a=list(map(int,input().split())) print(1,2,n) if a[0]+a[1] <= a[-1] else print(-1)
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) l=list(map(int,input().split())) c=0 if(l[0]+l[1]<=max(l)): a=l.index(max(l)) print(1,2,a+1) else: print(-1)
7
PYTHON3
t = int(input()) for q 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
for i in range(int(input())): a=int(input()) b=list(map(int,input().strip().split()))[:a] if len(b)<3: print(-1) else: sum=b[0]+b[1] if sum<=b[-1]: print(str(1)+" "+str(2)+" "+str(len(b))) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; using ll = long long int; using dl = double; const int N = 2e5 + 10; ll aarray[200000 + 10]; ll magic[101][101]; vector<ll> primes; bool prime[1000001]; int main() { ios_base::sync_with_stdio(false); string str; ll i, j, n, m, k, t; cin >> t; while (t--) { cin...
7
CPP
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(" ".join(['1','2',str(n)]))
7
PYTHON3
t = int(input()) for x in range(t) : n = int(input()) arr = list(map(int, input().split(" "))) i = 1 j = 2 l = arr[0] + arr[1] y = 2 while y < n : k = arr[y] if k >= l : k = y + 1 break y += 1 if y == n : print(-1) else : ...
7
PYTHON3
def solve(): n = int(input()) a = input().split(" ") a = [int(i) for i in a] if a[0] + a[1] <= a[-1]: print(1, 2, n) else: print(-1) t = int(input()) for i in range(t): solve()
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") else: print(1,2,n) t-=1
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; void solve() { int n; cin >> n; vector<int> arr(n); for (int i = 0; i < n; i++) cin >> arr[i]; if (n >= 3 && arr[0] + arr[1] <= arr[n - 1]) cout << "1 2 " << n << endl; else cout << "-1" << endl; } int main() { int T = 1; cin...
7
CPP
from sys import stdin g = lambda : stdin.readline().strip() gl = lambda : g().split() gil = lambda : [int(var) for var in gl()] gcl = lambda : list(g()) gbs = lambda : [int(var) for var in g()] mod = int(1e9)+7 inf = float("inf") t, = gil() from bisect import * for _ in range(t): n, = gil() a = gil() if a[0]+a[1...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL); ; int t; cin >> t; while (t--) { int a[5 * 10000 + 5] = {}; int n; cin >> n; for (int i = (0); i < (n); i += (1)) cin >> a[i]; if (a[0] + a[1] > a[n - 1...
7
CPP
#include <bits/stdc++.h> using namespace std; int main() { int T, n, vet[51234]; scanf("%d", &T); while (T--) { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &vet[i]); } if ((vet[0] + vet[1]) > vet[n - 1]) { puts("-1"); } else { printf("%d %d %d\n", 1, 2, n); ...
7
CPP
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { if (b == 0) return a; return gcd(b, a % b); } long long xyp(long long x, long long y) { long long res = 1; while (y > 0) { if (y % 2 == 1) res = (res * x) % 1000000007; x = (x * x) % 1000000007; y /= 2; } ret...
7
CPP
def finder(lst, sum): for i in range(2, len(lst)): if lst[i] >= sum: return i return -1 t = int(input()) result = list() for test_case in range(t): n = int(input()) lst = input() lst = lst.split() lst = list(map(int, lst)) one_res = finder(lst, lst[0] + lst[1]) ...
7
PYTHON3
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
t = int(input()) for i in range(t): n = int(input()) data = list(map(int , input().split())) if data[0] + data[1] <= data[-1]: print(1,2,n) else: print(-1)
7
PYTHON3
t=int(input()) for i in range(t): n=int(input()) s=input() l=s.split() lst=[] for i in range(len(l)): lst.append(int(l[i])) if(lst[0]+lst[1]<=lst[n-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[n-1]): print(1,2, n ) else: print(-1)
7
PYTHON3
def main(): t = int(input()) for _ in range(t): n = int(input()) s = list(map(int, input().split())) if s[0] + s[1] <= s[-1]: print(1, 2, n) else: print(-1) if __name__ == '__main__': main()
7
PYTHON3
t=int(input()) l=[] for i in range(t): n=int(input()) s=list(map(int,input().split())) l.append(s) for j in l: if j[0]+j[1]>j[-1]: print (-1) else: print(1,2,len(j))
7
PYTHON3