solution
stringlengths
11
983k
difficulty
int64
0
21
language
stringclasses
2 values
t=int(input()) def check(a,b,c): if c>=b+a: return True else: return False while t: t-=1 n=int(input()) a=[int(i) for i in input().split()] a.sort() if check(a[0],a[1],a[-1]): print(1,2,n) else: print(-1)
7
PYTHON3
cases = int(input()) for i in range(cases): n = int(input()) line2 = input().split(' ') arr = [] for a in line2: arr.append(int(a)) mi = arr[0] pos = False for j in range(1,n): s = mi + arr[j] if s <= arr[-1]: print(1, j+1, n) pos = True ...
7
PYTHON3
def main(): test_case = int(input()) for i in range(test_case): n = int(input()) lst = list(map(int,input().split())) if(lst[0] + lst[1] <= lst[n-1]): print("{0} {1} {2}".format(1,2,n)) else: print("-1") main()
7
PYTHON3
inp = lambda cast=int: [cast(x) for x in input().split()] printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs) t, = inp() for _ in range(t): n, = inp() A = inp() a, b, c = A[0], A[1], A[-1] if a + b <= c: 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[0]+a[1]<=a[-1]: print(1,2,len(a)) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) cin >> v[i]; if (v[0] + v[1] <= v.back()) cout << "1 2 " << n << "\n"; else cout << "-1\n"; } int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int tst...
7
CPP
m=int(input()) for i in range(m): n=int(input()) a=list(map(int,input().split(' '))) for j in range(2,len(a)): if a[j]>=a[0]+a[1]: print(1 ,2 ,j+1) break else: print(-1)
7
PYTHON3
import sys read = lambda: sys.stdin.readline().strip() for _ in range(int(read())): length = int(read()) nums = list(map(int, read().split())) end = length - 1 start = 0 mid = start + 1 a = nums[start] b = nums[mid] c = nums[end] # print("Ans", end=" ") if a + b <= c:...
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 _ in range(t): n=int(input()) a=list(map(int,input().split())) sum1=a[0]+a[1] found=0 for i in range(2,n): if sum1<=a[i]: found=1 break if found!=1: print("-1") else: print(1,2,i+1)
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[-1]: print("1 2 {}".format(n)) else: print(-1)
7
PYTHON3
import sys t=int(sys.stdin.readline()) for _ in range(t): n=int(sys.stdin.readline()) a=list(map(int,(sys.stdin.readline()).split())) counter=0 for i in range(n-1): su=a[i]+a[i+1] if su <=a[n-1]: print('{} {} {}'.format(i+1,i+2,n)) counter=1 break ...
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) else: print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) arr = list(map(int,input().split())) notexist = False for i in range(2,len(arr)): if arr[0] + arr[1] <= arr[i]: n = i + 1 notexist = True break if notexist: print(1,2,n) else: print(-1) ...
7
PYTHON3
for i in range(int(input())): n=int(input()) x=list(map(int,input().split())) if x[0]+x[1]>x[-1]: print(-1) else: print(1,2,n)
7
PYTHON3
t = int(input()) while(t): n = int(input()) l = [int(i) for i in input().split()] for i in range(n): for j in range(1,n): for k in range(2,n): if((l[i] + l[j]) > l[k]): pass else: print(i+1,j+1,k+1) ...
7
PYTHON3
# This is a sample Python script. # Press ⌃R to execute it or replace it with your code. # Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. def check(arrayList): result = "-1" if arrayList[0] + arrayList[1] <= arrayList[len(arrayList)-1]: last_index = str(le...
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,n) else: print(-1)
7
PYTHON3
t = int(input()) while t: n, v = int(input()), list(map(int, input().split())) print("1 2 " + str(n) if v[0]+v[1] <= v[n-1] else -1) t -= 1
7
PYTHON3
import sys # sys.stdin = open("input.txt") def main(): tn = int(sys.stdin.readline()) r = None for ti in range(tn): n = int(sys.stdin.readline()) A = [int(a) for a in sys.stdin.readline().split()] if A[0] + A[1] <= A[-1]: print(f"1 2 {n}") else: pri...
7
PYTHON3
t=int(input()) while (t>0): t=t-1 n=int(input()) a=list(map(int,input().split())) c=a[0]+a[1] d=0 for i in range(2,len(a)): if (c<=a[i]): d=i+1 break if (d!=0): print(1,2,d) else: print(-1)
7
PYTHON3
t=int(input()) for _ in range(t): n=int(input()) a=list(map(int,input().split())) for i in range(n): for j in range(i+1,n): if a[i] + a[j] <= a[-1]: print(i+1,j+1,n) break else: print('-1') break break
7
PYTHON3
t = int(input()) for i in range(t): n = int(input()) l = list(map(int,input().split())) ans = [] flag = 0 for j in range(2,n): if(l[0]+l[1]<=l[j]): flag = 1 ans = [1,2,j+1] break if(flag==1): print(*ans) else: print(-1)
7
PYTHON3
t = int(input()) for case in range(t): n = int(input()) a = list(map(int, input().split())) minNum = 1000000000 minInd = -1 maxNum = 0 maxInd = -1 for i in range(n): num = a[i] if num < minNum: minInd = i minNum = num if num > maxNum: ...
7
PYTHON3
def badTriangle(arr): if arr[0] + arr[1] in arr: print(*[1,2, arr.index(arr[0]+arr[1])+1]) elif arr[0] + arr[1] <= arr[-1]: print(*[1,2,len(arr)]) else: print(-1) tc = int(input()) for i in range(tc): n = int(input()) a = list(map(int, input().split())) badTriang...
7
PYTHON3
def solve(): n = int(input()) l = [int(x) for x in input().split()] for i in range(2, n): if l[0]+l[1] <= l[i]: print(1,2,i+1) break else: print(-1) for _ in range(int(input())): solve()
7
PYTHON3
#!/usr/bin/env python3 def main(): for _ in range(int(input())): n = int(input()) a = sorted(map(int, input().split())) if a[0] + a[1] <= a[-1]: print(1, 2, n) else: print(-1) if __name__ == "__main__": main()
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) done = 0 if (a[0] + a[1] <= a[-1]): print(1, 2, n) else: print(-1)
7
PYTHON3
t = int(input()) for i in range(t): n = int(input()) arr = input() arr = arr.strip() arr = arr.split(' ') arr = list(map(int, arr)) a = arr[0] b = arr[1] c = arr[n-1] if c >= a+b : print(1, 2, n) else: print(-1)
7
PYTHON3
def solve(arr): n = len(arr) if arr[0] + arr[1] <= arr[-1]: return [1, 2, n] return -1 t = int(input()) while t: n = int(input()) arr = list(map(int, input().split())) res = (solve(arr)) if res == -1: print(-1) else: print(" ".join(list(map(str,res)))) ...
7
PYTHON3
for t in range(int(input())): n=int(input()) num=list(map(int,input().split())) if num[-1]<num[0]+num[1]: print(-1) else: print(1,2,n)
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) a = sorted([int(x) for x in input().split()]) if a[0]+a[1]>a[-1]: print(-1) else: print(1,2,len(a))
7
PYTHON3
t = int(input()) def doit(t): s = int(input()) a = input() na = list(map(int, a.split())) if na[0] + na[1] > na[s-1]: print(-1) else: print("1 2", s) while t: t -= 1 doit(t)
7
PYTHON3
def algo(a, N): if a[0]+a[1]<=a[-1]: s="1"+" "+"2"+" "+str(n) return s return -1 for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) print(algo(a,n))
7
PYTHON3
for i in range(int(input())): s = input() x = list(map(int, input().split())) if x[0] + x[1] <= x[-1]: print(1, 2, len(x), sep=" ") else: print(-1)
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) a = [int(ele) for ele in input().split()] if (a[0] + a[1]) <= a[-1]: print(1, 2, n, end = " ") print("") else: print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) arr =[int(c) for c in input().split()] if arr[0] + arr[1] <= arr[-1] : 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(f"1 2 {n}") else: print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) a = [int(i) for i in input().split()] ans = [-1] a.sort() if a[0] + a[1] <= a[n-1]: ans = [1,2,n] print(*ans)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int main() { int t; scanf("%d", &t); ; while (t--) { int n; scanf("%d", &n); ; long long arr[n]; for (int i = 0; i < n; i++) scanf("%lld", &arr[i]); ; if (arr[0] + arr[1] <= arr[n - 1]) { cout << 1 << " " << 2...
7
CPP
for t in range(int(input())): n = int(input()) a = list(map(int, input().split())) if a[-1] >= a[0] + a[1]: print(1, 2, len(a)) else: print(-1)
7
PYTHON3
t = int(input()) flag = bool(False) for q in range(t): a = [] flag = False c = int(input()) a = list(map(int, input().split())) for e in range (1, c-1): if (a[0] + a[e] <= a[c-1]): flag = True break if (flag == True): print (1, e+1, c) ...
7
PYTHON3
t=int(input()) for i in range(t): 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
for t in range(int(input())): n = int(input()) a = list(map(int, input().split())) v = a[0] + a[1] ans = 0 for i in range(2,n): if a[i] >= v: ans = i break if ans: print(1,2,ans+1) else: print(-1)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int t; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> t; while (t--) { int n, fir, sec, last; cin >> n; for (int i = 1; i <= n; i++) { int x; cin >> x; if (i == 1) fir = x; if (i == 2) sec = x; if (i...
7
CPP
from collections import defaultdict t=int(input()) while(t>0): t-=1 n=int(input()) a=[int(j) for j in input().split()] if(a[0]+a[1]<=a[-1]): print("1 2",end=" ") print(len(a)) else: print(-1)
7
PYTHON3
import sys t=int(input()) while t>0: n=int(input()) a=[int(x) for x in input().split()] s=a[0]+a[1] c=0 for i in range(2,n): if(a[i]>=s): print(1,2,i+1) c+=1 break if(c==0): print(-1) t-=1
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin >> t; while (t--) { int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int f = -1; for (int i = 2; i < n; i++) { if (a...
7
CPP
MOD = 1000000007 ii = lambda : int(input()) si = lambda : input() dgl = lambda : list(map(int, input())) f = lambda : map(int, input().split()) il = lambda : list(map(int, input().split())) ls = lambda : list(input()) from collections import Counter for _ in range(ii()): n=ii() a=il() if(a[0]+a[1]>a[n...
7
PYTHON3
import sys import os.path # ========================================================================= if(os.path.exists('in.txt')): sys.stdin = open("in.txt", "r") sys.stdout = open("out.txt", "w") # ============================================================================================= for _ in range(in...
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,len(a))
7
PYTHON3
import math as mt def tran(n,arr): if arr[0]+arr[1]>arr[-1]: return [-1] else: return [1,2,n] if __name__ == '__main__': t = int(input()) ans = [] for i in range(t): n=int(input()) arr = list(map(int, input().rstrip().split())) r = tran(n,arr) ans.app...
7
PYTHON3
# bad_triangle.py for _ in range(int(input())): n = int(input()) a = list(map(int,input().split())) sm = a[0]+a[1] ok = True for i in range(n-1,1,-1): if a[i]>=sm: print(1,2,i+1) ok = False break if ok: print('-1')
7
PYTHON3
for i in range(int(input())): n=int(input()) l=[int(x) for x in input().split()] count=0 if l[0]+l[1]<=l[n-1]: print(*[1,2,n]) else: print(-1)
7
PYTHON3
test_cases = int(input()) for _ in range(test_cases): 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
#code By Abhishek def solve(arr,n): for i in range(2,n): if arr[0] + arr[1]<=arr[i]: print(1,2,i+1) return print(-1) return for _ in range(int(input())): n=int(input()) arr=list(map(int,input().split())) solve(arr,n)
7
PYTHON3
#include <bits/stdc++.h> using namespace std; void solve() { long long int n; cin >> n; long long int a[n]; long long int i; for (long long int i = 0; i < n; i += 1) cin >> a[i]; if ((a[0] + a[1]) > a[n - 1]) cout << -1 << '\n'; else cout << 1 << " " << 2 << " " << n << '\n'; } int main() { ios:...
7
CPP
#include <bits/stdc++.h> using namespace std; const long long INF = 2e15; const long long MB = 20; const long long MOD = 1e9 + 7; void solve() { long long n; cin >> n; vector<long long> a(n); for (long long i = 0; i < n; i++) { cin >> a[i]; } if (a.back() >= a[0] + a[1]) { cout << "1 2 " << n << '\n...
7
CPP
n=int(input()) for i in range(n): t=int(input()) c=list(map(int,input().split())) g=c[0]+c[1] h=0 for j in range(2,t): if(g<=c[j]): h=j break if(h!=0): print(1,end=" ") print(2,end=" ") print(h+1,end=" ") print() else: print(-1)
7
PYTHON3
for _ in range(int(input())): n = int(input()) arr = list(map(int,input().split())) print(*[[1,2,n],[-1]][arr[0]+arr[1]>arr[n-1]])
7
PYTHON3
def resolve(): N = int(input()) for _ in range(N): length_of_array = int(input()) A = [int(x) for x in input().split(" ")] isFound = False for i in range(length_of_array - 2): if A[i] + A[i+1] <= A[length_of_array-1]: isFound = True print(i+1, i+2, length_of_array) brea...
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
t=int(input()) for _ in range(t): n=int(input()) ls=list(map(int,input().split())) s=ls[0]+ls[1] if ls[-1]<s: print(-1) else: print('{} {} {}'.format(1,2,n))
7
PYTHON3
t = int(input()) while t>0: n = int(input()) a = input().split(" ") i, j, k = 0, 1, n-1 if int(a[i])+int(a[j])<=int(a[k]) or int(a[j])+int(a[k])<=int(a[i]) or int(a[i])+int(a[k])<=int(a[j]): print(i+1, j+1, k+1) else: print(-1) t-=1
7
PYTHON3
t=int(input()) l=[] for i in range(0,t): n=int(input()) s=input() l=s.split() if int(l[0])+int(l[1])>int(l[-1]): print(-1) else: print(1,2,n)
7
PYTHON3
from sys import stdin 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(0,t): m=int(input()) arr1=list(map(int,input().strip().split()))[:m] l1=[] ct=0 for i in range(0,m-2): if(arr1[i]+arr1[i+1]<=arr1[-1]): l1.append(i+1) l1.append(i+2) l1.append(m) print(*l1,sep=" ") ct+=...
7
PYTHON3
import sys, math # input = lambda: sys.stdin.readline().rstrip() def pr(a, b, c): if a + b > c and a + c > b and c + b > a: return True return False for i in range(int(input())): n = int(input()) a = list(map(int, input().split())) f, t = a[0], a[1] ans = True for i in range(2, n...
7
PYTHON3
t = int(input()) for _ in range(t): n = int(input()) vals = [int(x) for x in input().split()] if vals[0] + vals[1] <= vals[-1]: print(1, 2, n) else: print(-1)
7
PYTHON3
# https://codeforces.com/problemset/problem/1398/A for _ in range(int(input())): n = input() lengths = tuple(map(int, input().split())) if lengths[0] + lengths[1] > lengths[-1]: print(-1) else: print(1, 2, n)
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 ctr 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
t = int(input()) for asdasd in range(t): n = int(input()) a = [int(x) for x in input().split()] p = a[0] q = a[1] r = a[n-1] if(p+q <= r): print(1,2,n) else: print("-1")
7
PYTHON3
#include <bits/stdc++.h> using namespace std; long long max(long long a, long long b) { if (a > b) return a; else return b; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long t; cin >> t; while (t--) { long long n; cin >> n; vector<long long> v(n); fo...
7
CPP
x=int(input()) for z in range(x): 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
#include <bits/stdc++.h> using namespace std; const int N = 100007; int main() { ios::sync_with_stdio(false); cin.tie(0); int t = 1; cin >> t; while (t--) { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int ind; bool found = false; if (a[0] + a[1...
7
CPP
T = int(input()) for test in range(T): n = int(input()) a = [int(x) for x in input().split()] if a[0] + a[1] <= a[-1]: print("1 2 {}".format(n)) else: print(-1)
7
PYTHON3
""" pppppppppppppppppppp ppppp ppppppppppppppppppp ppppppp ppppppppppppppppppppp pppppppp pppppppppppppppppppppp pppppppppppppppppppppppppppppppp pppppppppppppppppppp...
7
PYTHON3
t=int(input()) for _ in range(t): n=int(input()) l=list(map(int,input().split())) f=0 for i in range(2,n): if l[0]+l[1]<=l[i]: f=1 print(1,2,i+1) break if f==0: 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
import bisect t = int(input()) ans = [] for _ in range(t): n = int(input()) A = list(map(int, input().split())) i = 0 j = 1 check_index = bisect.bisect_left(A, A[i] + A[j]) if check_index >= n: ans.append([-1]) else: k = check_index ans.append([i+1, j+1, k+1]) ...
7
PYTHON3
t = int(input()) for te in range(t): n = int(input()) a = [int(x) for x in input().split()] a.sort() if (a[0] + a[1] <= a[n - 1]): print(1, 2, n) else: print(-1)
7
PYTHON3
from collections import defaultdict as dd import math import sys import string input=sys.stdin.readline def nn(): return int(input()) def li(): return list(input()) def mi(): return map(int, input().split()) def lm(): return list(map(int, input().split())) def solve(): n = nn() lens = lm() if lens[0]+len...
7
PYTHON3
import sys input = sys.stdin.readline for nt 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 math import * from collections import deque from copy import deepcopy import sys def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input def multi(): return map(int,input().split()) def strmulti(): return map(str, inp().split()) def lis(): return list(map(int, inp().split())) def lcm(a,b): return (a*...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { long long int n; cin >> n; long long int a[n]; for (long long int j = 0; j < n; j++) { cin >> a[j]; } if (a[0] + a[1] <= a[n - 1]) cout << "1 2 " << n << endl; else ...
7
CPP
import math def dtb(n): return bin(n).replace("0b","") def btd(n): return int(n,2) t=int(input()) for k in range(t): n=int(input()) a=list(map(int,input().split()))[:n] x,z=0,n-1 flag=0 for i in range(1,n-1): if(a[i]+a[x]<=a[z] or a[i]+a[z]<=a[x] or a[x]+a[z]<=a[i]): p...
7
PYTHON3
try: for _ in range(int(input())): a=int(input()) b=list(map(int,input().split())) i=0 k=a-1 flag=True j=a-2 while flag and i<j and j<k: temp=b[k]-b[i] if b[j]<=temp: print(i+1,j+1,k+1) flag=False ...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; const long double EPS = 1e-10; const long long INF = 1e18; const long double PI = acos(-1.0L); long long gcd(long long a, long long b) { if (b == 0) { return a; } return gcd(b, a % b); } int main() { int cnt = 1; int t; cin >> t; while (t--) { int n; ...
7
CPP
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,len(a)) else: print(-1)
7
PYTHON3
t = int(input()) r = "" for i in range(t): n = int(input()) a = [] a = input().split() if int(a[0]) + int(a[1]) <= int(a[len(a) - 1]): r += "1 2 " + str(len(a)) + "\n" else: r += "-1\n" """ for j in range(n): b = int(a[j]) for j in range(n): for k in range...
7
PYTHON3
tests = int(input()) for test in range(tests): num = int(input()) nums = list(map(int, input().split())) if nums[0] + nums[1] <= nums[-1]: print(1, 2, num) else: print(-1)
7
PYTHON3
import sys def input(): return sys.stdin.readline().strip() def list2d(a, b, c): return [[c] * b for i in range(a)] def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)] def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)] def ceil(x, y=1): retu...
7
PYTHON3
import sys import random from fractions import Fraction from math import * def input(): return sys.stdin.readline().strip() def iinput(): return int(input()) def finput(): return float(input()) def tinput(): return input().split() def linput(): return list(input()) def rinput(): return ...
7
PYTHON3
#include <bits/stdc++.h> using namespace std; int main() { int t, n, flag, j; cin >> t; int arr1[t]; for (int i = 0; i < t; i++) { cin >> n; int arr[n]; for (j = 0; j < n; j++) { cin >> arr[j]; } flag = 0; for (j = 2; j < n; j++) { if (arr[j] >= arr[0] + arr[1]) { fla...
7
CPP
for i in range(int(input())): n=int(input()) arr=list(map(int,input().split())) flag=0 for i in range(len(arr)-1): for j in range(i+1,len(arr)-1): if arr[i]+arr[j]<=arr[len(arr)-1]: flag=1 print(i+1,j+1,len(arr)) m=len(arr) ...
7
PYTHON3
def sieve(): n=10**5 s=[[] for i in range(n+1)] for i in range(2,n+1,2): s[i]=[2] for i in range(3,n+1,2): if(s[i]): continue else: for j in range(i,n+1,i): s[j].append(i) return s def prime(): n=10**5 s=[1 for i in range(n+1)] ...
7
PYTHON3
for xyz in range(0,int(input())): 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
#include <bits/stdc++.h> using namespace std; int main() { int t, n, i; scanf("%d", &t); while (t--) { scanf("%d", &n); vector<int> a(n); for (i = 0; i < n; i++) scanf("%d", &a[i]); if (a[0] + a[1] <= a[n - 1]) printf("1 2 %d\n", n); else printf("-1\n"); } return 0; }
7
CPP
#include <bits/stdc++.h> using namespace std; void solve() { long long int n; cin >> n; vector<long long int> arr; set<long long int> s; for (int i = 0; i < n; i++) { long long int val; cin >> val; arr.push_back(val); } bool temp = false; long long int sum = arr[0] + arr[1]; for (int i = 2...
7
CPP