solution stringlengths 11 983k | difficulty int64 0 21 | language stringclasses 2
values |
|---|---|---|
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,len(arr))
else:
print(-1) | 7 | PYTHON3 |
import sys
import math
import time
from functools import lru_cache
from collections import Counter
import heapq
#@lru_cache(maxsize=None) #for optimizing the execution time of callable objects/functions(placed above callable functions)
def pw(a,b,m):
a%=m
ans=1
if a==0:return 0
while(b>0):
if(b&... | 7 | PYTHON3 |
import datetime
def check(ar):
for i in range(len(ar)-2):
s=ar[i]+ar[i+1]
j=len(ar)-1
if(s<=ar[j]):
li=i+1,i+2,j+1
return list(li)
else:
return [-1]
if __name__=="__main__":
n=int(input())
res=[]
for _ in range(n):
q=int... | 7 | PYTHON3 |
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
x = int(input())
n = list(map(int,input().split()))
if n[0] + n[1] <= n[-1]:
print(1,2,len(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,(a.index(a[-1])+1))
else:
print(-1) | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
arr = [int(x) for x in input().split()]
arr.sort()
if arr[0]+arr[1]<=arr[len(arr)-1]:
print(1,2,len(arr))
else:
print(-1)
| 7 | PYTHON3 |
#------------------------------warmup----------------------------
# *******************************
# * AUTHOR: RAJDEEP GHOSH *
# * NICK : Rajdeep2k *
# * INSTITUTION: IIEST, SHIBPUR *
# *******************************
import os
import sys
from io import BytesIO, IOBase
import math
BUFSIZE = 819... | 7 | PYTHON3 |
for _ in range(int(input())):
length = int(input())
if length < 3:
print(-1); continue
sequence = [int(i) for i in input().split()]
min_side = sequence[0]; max_side = sequence[-1]
if sequence[1] <= max_side - min_side:
print(1, 2, length)
else:
print(-1) | 7 | PYTHON3 |
# non-degenerate triangle conditions:
# a+b>c
# a+c>b
# b+c>a
t = int(input())
for _ in range(t):
n = int(input())
a = [int(i) for i in input().split(" ")]
i = 0
j = 1
k = len(a) - 1
while j<k:
if a[i] + a[j] <= a[k]:
print(i+1, j+1, k+1)
break
i+=1
... | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
input()
l = [int(i) for i in input().split()]
ok = False
if sum(l[:2]) > l[-1]:
# Se os menores dos lados podem combinar com o maior
# para formar um triΓ’ngulo "de verdade" (nΓ£o degenerado),
# entΓ£o Γ© impossΓvel formar triΓ’ngulo degenerado se ... | 7 | PYTHON3 |
for i in range(int(input())):
N=int(input())
side_array=list(map(int,input().split()))
for i in range(2,N):
if side_array[0]+side_array[1]<=side_array[i]:
flag=1
d=i
break
else:
flag=0
if flag==1:
print(1,2,d+1)
else:
pr... | 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
A = list(map(int,input().split()))
a = A[0]+A[1]
if(A[-1]>=a):
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());
void c_p_c() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
double pi = 3.141592653589;
void solve() {
long long n;
cin >> n;
long long a[n];
for (long long &i : a) cin >> i;
if... | 7 | CPP |
def answer(n,A):
if A[0]+A[1]>A[-1]:
return [-1]
else:
return [1,2,n]
t=int(input())
for i in range(t):
n=int(input())
arr=list(map(int,input().split()))
print(*answer(n,arr)) | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
l = list(map(int,input().split()))
a = 0
b = 1
c = 2
knt = 0
while c<n:
if l[a] + l[b] <= l[c]:
print(a+1,b+1,c+1)
knt = 1
break
c+=1
if knt == 0:
print("-1")
| 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("{} {} {}".format(1, 2, n))
continue
else:
print(-1) | 7 | PYTHON3 |
def main():
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().strip().split()))
if a[0] + a[1] <= a[-1]:
print("1 2", n)
else: print(-1)
if __name__ == "__main__": main() | 7 | PYTHON3 |
t = int(input())
while t > 0:
n = int(input())
arr = list(map(int , input().split()))
flag = True
if arr[0] + arr[1] > arr[-1]:
print(-1)
else:
print(1,2,n)
t -= 1 | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
for i in range(1, n - 1):
if a[n-1] >= a[0] + a[i]:
print(1, i+1, n)
break
else:
print(-1) | 7 | PYTHON3 |
from bisect import bisect_left
for _ in range(int(input())):
n = int(input())
a = [*map(int, input().split())]
a.sort()
ans = [-1]
for i in range(1, n):
j = bisect_left(a, a[i] + a[i - 1])
if j < n:
ans = (i, i + 1, j + 1)
print(*ans) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
i1, i2, i3 = a[0], a[1], a[-1]
if i1 + i2 <= i3 or i1 + i3 <= i2 or i3 + i2 <= i1:
print(1, 2, n)
# for i in range(n-2):
# i1, i2, i3 = a[i], a[i+1], a[i+2]
# if i1 + i2 <= i3 or i1 + i3... | 7 | PYTHON3 |
from sys import stdin
input = stdin.buffer.readline
inf = 1000000001
for _ in range(int(input())):
n = int(input())
*a, = map(int, input().split())
a = sorted([(a[i], i + 1) for i in range(n)])
if a[-1][0] >= a[0][0] + a[1][0]:
print(*sorted([a[0][1], a[1][1], a[-1][1]]))
else:
print... | 7 | PYTHON3 |
t = int(input())
while t:
t += -1
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 |
#include <bits/stdc++.h>
using namespace std;
long long amax(long long a[], long long n) {
long long max = 0;
for (long long i = 0; i < n; i++) {
if (a[i] > max) max = a[i];
}
return max;
}
long long amin(long long a[], long long n) {
long long min = 1000000000;
for (long long i = 0; i < n; i++) {
i... | 7 | CPP |
for i in range(int(input())):
n=int(input())
a=list(map(int,input().split()))[:n]
print(*([1,2,n],[-1])[a[0]+a[1]>a[-1]])
| 7 | PYTHON3 |
N = int(input())
LIS = [0 for i in range (N)]
for j in range(N):
x = int(input())
listik = [int(i) for i in input().split()]
if ((listik[0] + listik[1]) <= listik[x-1]):
LIS[j] = [1,2,x]
else: LIS[j] = [-1]
for lis in LIS:
lis = [str(i) for i in lis]
print(' '.join(lis)) | 7 | PYTHON3 |
t=int(input())
for test in range(t):
n=int(input())
arr=[int(x) for x in input().split()]
if arr[0] +arr[1] <= arr[n-1]:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
rounds = int(input())
for _ in range(rounds):
n = int(input())
values = list(map(int, input().split()))
if values[0] + values[1] <= values[-1]:
print(1, 2, len(values))
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[n - 1]):
print(1, 2, n)
else:
print(-1) | 7 | PYTHON3 |
import bisect
for t in range(int(input())):
n=int(input())
arr=list(map(int,input().split()))
for i in range(n-2):
first=arr[i]
second=arr[i+1]
maxim_no=first+second
if arr[-1]<maxim_no:
print(-1)
break
else:
print(i+1,i+2,n)
... | 7 | PYTHON3 |
def find(li, n):
for i in range(n - 2):
if li[i] + li[i + 1] <= li[n - 1]:
return i + 1, i + 2, n
return None
for j in range(int(input())):
n = int(input())
li = [int(x) for x in input().split()]
print(*find(li, n)) if find(li, n) != None else print(-1)
| 7 | PYTHON3 |
import sys
def inp():
inp = input().split()
if len(inp) == 1:
return int(inp[0])
else:
return (int(i) for i in inp)
def inpl():
inp = input().split()
for i in range (len(inp)):
inp[i]=int(inp[i])
return inp
# Problem 1
testcases = inp()
for testcase in range (test... | 7 | PYTHON3 |
a = int(input())
for i in range(a):
n = int(input())
a = list(map(int, input().split()))
res = []
i = 0
j = 1
k = 2
while k < len(a) and a[i] + a[j] > a[k]:
k += 1
if k == len(a):
print(-1)
else:
print(i + 1, j + 1, k + 1)
| 7 | PYTHON3 |
import sys
def main():
res = ''
input = sys.stdin.readline
print = sys.stdout.write
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[n - 1]:
sub_res = f'{1} {2} {n}\n'
else:
sub_res ... | 7 | PYTHON3 |
T = int(input())
for t 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 |
import sys
import math
from math import *
from collections import Counter,defaultdict
from io import BytesIO, IOBase
from collections import deque
import bisect
def main():
n = int(input())
arr = list(map(int, input().split()))
if arr[0]+arr[1]>arr[-1]:
print(-1)
else:
print(1,2,n)
for i in range(int(inp... | 7 | PYTHON3 |
cases=int(input())
for _ in range(cases):
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;
long long int gcd(long long int a, long long int b) {
return b == 0 ? a : gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
return (a * b) / gcd(a, b);
}
bool isprime(long long int x) {
for (long long int i = 2; i <= sqrt(x); i++) {
if (x % i ... | 7 | CPP |
# Hey, there Stalker!!!
# This Code was written by:
# βββββββββββββββββββββ
# βββββββββ¦ββββββββββββ
# βββββββββββββ ββββββββ
# βββββββββββββ β¬βββ£ββββ
# βββββββββββββ β£βββ£ββββ
# βββββ£ββββββββββββ£ββββ
# βββββ©ββββ©ββββ£β βββ©ββββ
# βββββββββββββββββββββ
# βββββββββββββββββββββ
# βββββββββββββββββββββ
#from functools import reduc... | 7 | PYTHON3 |
def find_sides_indices(sorted_array):
if sorted_array[0] + sorted_array[1] <= sorted_array[-1]:
result = (0, 1, len(sorted_array) - 1)
else:
result = None
return result
def main():
t = int(input())
for i in range(t):
n = int(input())
a = tuple(map(int, input().split... | 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.wri... | 7 | PYTHON3 |
# import bisect
import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
from collections import deque
from functools import cmp_to_key
import math
# import heapq
def sin():
return input()
def ain():
return list(map(int, sin().split()))
def sain():
return input().spl... | 7 | PYTHON3 |
for i in range(int(input())):
x=int(input())
l=list(map(int,input().split()))
hi=l[-1]
lo=l[0]
ne=l[1]
if lo+ne>hi:
print(-1)
else:
print('1 2',end=' ')
print(len(l)) | 7 | PYTHON3 |
for _ in range(int(input())):
n, arr = int(input()), list(map(int, input().split()))
a,b = arr[0],arr[1]
s = a+b
f = 1
for i in range(2,n):
if s <= arr[i]:
f = 0
print(1,2,i+1)
break
if f:
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;
const long long mod = 1000000007;
const long long long_max = 9223372036854775807;
const long long inf = INT_MAX;
void pr(long long n) { cout << (n) << "\n"; }
void pr(string s) { cout << (s) << "\n"; }
void pr(string s, string s2) { cout << (s) << " " << (s2) << "\n"; }
voi... | 7 | CPP |
from sys import stdin, gettrace
if gettrace():
inputi = input
else:
def input():
return next(stdin)[:-1]
def inputi():
return stdin.buffer.readline()
def solve():
n = int(inputi())
aa = [int(a) for a in inputi().split()]
if aa[0] + aa[1] <= aa[-1]:
print(1, 2, n)
... | 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)
else:
print(1, 2, n) | 7 | PYTHON3 |
t=int(input())
for g 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())
for i in range(t):
n = int(input())
arr = [int(k) for k in input().split()]
found = False
k = 2
for j in range(n-2):
while k < n and arr[j] + arr[j+1] > arr[k]:
k += 1
if k < n:
print(j+1, j+2, k+1)
found = True
break
... | 7 | PYTHON3 |
T = int(input())
for t in range(T):
n = int(input())
a = list(map(int, input().split()))
# for i in range(n):
# for j in range(i+1,n):
# for k in range(n-1,j):
# if a[i] + a[j] <= a[k]:
if a[0] + a[1] <= a[n-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
for vishal 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 |
for t 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 |
for _ in range(int(input())):
n=int(input())
s=[int(i) for i in input().split()]
a=s[0]+s[1]
k=-1
for j in range(2,n):
if a<=s[j]:
k=j+1
break
if k!=-1:
print(1,2,k)
else:
print(-1)
| 7 | PYTHON3 |
T = int(input())
for case in range(T):
i = int(input())
#s = input()
#m,n = [int(x) for x in input().split()]
ls = [int(x) for x in input().split()]
if ls[0] + ls[1] <= ls[-1]:
print(1,2,len(ls))
else:
print(-1)
#print(r)
| 7 | PYTHON3 |
for _ in range(int(input())):
m = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] > a[-1]:
print(-1)
else:
print(1,2,m)
| 7 | PYTHON3 |
testcases = int(input())
for testcase in range(testcases):
n = int(input())
temparr = input()
temparr = temparr.split()
arr = []
for i in temparr:
arr.append(int(i))
l1 = 0
l2 = 1
l3 = n - 1
flag = 0
if arr[l1] + arr[l2] <= arr[l3]:
flag = 1
if flag ... | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
arr = list(map(int,input().split()))
for i in range(len(arr)-1,1,-1):
if arr[0] + arr[1] <= arr[i]:
print(1,2,arr.index(arr[i])+1)
break
else:
print(-1)
| 7 | PYTHON3 |
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
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 |
t = int(input())
def satisfy(a, b, c):
return a + b > c and a + c > b and b + c > a
for case in range(t):
n = int(input())
a = list(map(int, input().split()))
done = False
if not satisfy(a[0], a[n - 2], a[n - 1]):
print(1, n - 1, n)
elif not satisfy(a[0], a[1], a[n - 1]):
print... | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
l = list(map(int, input().split()))
print(f'1 2 {n}' if l[0] + l[1] <= l[n - 1] else -1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
bool isPowerOfTwo(long long int x) { return x && (!(x & (x - 1))); }
void solve() {
long long int n;
cin >> n;
vector<pair<long long int, long long int>> vp;
for (long long int i = 0; i < n; ++i) {
long long int x;
cin >> x;
vp.push_back({x, i + 1});
}... | 7 | CPP |
t = int(input())
for _ in range(t):
n = int(input())
nums = list(map(int,input().split()))
if nums[0] + nums[1] <= nums[-1]:
print(*[1,2,n])
else:
print(-1)
| 7 | PYTHON3 |
import sys
input = sys.stdin.readline
for _ in range(int(input())):
n = int(input())
arr = list(map(int,input().split()))
a,b,c = arr[0], arr[1], arr[-1]
if a+b>c:
print(-1)
else:
print(1,2,n)
| 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())
while t:
n = int(input())
a = list(map(int,input().split(" ")))
k = n-1
flag=0
for i in range(n-2):
if a[i]+a[i+1] <= a[k]:
print(f'{i+1} {i+2} {k+1}')
flag=1
break
if flag==0:
print('-1')
t-=1 | 7 | PYTHON3 |
#!/usr/bin/env python
t = int(input())
for _ in range(t):
input()
lst = list(map(int, input().split()))
if lst[0] + lst[1] <= lst[-1]:
print(1, 2, len(lst))
else:
print(-1)
| 7 | PYTHON3 |
import sys
input = sys.stdin.readline
def inInt():
return int(input())
def inStr():
return input().strip("\n")
def inIList():
return (list(map(int, input().split())))
def inSList():
return (input().split())
####################################################
def solve(n, l):
if l[0] + l[1] <... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long t, n, i;
cin >> t;
while (t--) {
cin >> n;
int a[n], x = 0;
for (i = 0; i < n; i++) cin >> a[i];
for (i = 2; i < n; i++) {
if ((a[0] + a[1]) <= a[i]) {
cout << "1"
<< " "
<< "2"
<< ... | 7 | CPP |
t = int(input())
for l in range(t):
n = int(input())
ar = list(map(int,input().strip().split()))
if ar[0]+ar[1]<=ar[-1]:
print(1,2,len(ar))
else:
print(-1) | 7 | PYTHON3 |
from sys import stdin,stdout
from math import gcd,sqrt,factorial
from collections import deque,defaultdict
input=stdin.readline
R=lambda:map(int,input().split())
I=lambda:int(input())
S=lambda:input().rstrip('\n')
L=lambda:list(R())
P=lambda x:stdout.write(x)
lcm=lambda x,y:(x*y)//gcd(x,y)
hg=lambda x,y:((y+x-1)//x)*x
... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
void think() {
long long n;
cin >> n;
vector<long long> a(n, 0);
for (long long i = 0; i < n; i++) {
cin >> a[i];
}
if (a[0] + a[1] <= a[n - 1]) {
cout << 1 << " " << 2 << " " << n << "\n";
} else {
cout << -1 << "\n";
}
}
int32_t main() {
ios_... | 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 1e5 + 10;
int t, n, a[N];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
cin >> t;
while (t--) {
cin >> n;
for (int i = 1; i <= n; ++i) cin >> a[i];
int x = a[1], y = a[2], z = a[n... | 7 | CPP |
from collections import defaultdict
for i in range(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 |
t = int(input())
for _ in range(0,t):
n = int(input())
a = [int(i) for i in input().split()]
aa,bb,cc = a[0],a[1],a[-1]
if aa+bb > cc and aa+cc > bb and bb+cc > aa:
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
n_sets = int(input())
for i in range(n_sets):
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 |
b=int(input())
for _ in range (b):
a=int(input())
c=list(map(int,input().split()))
c.sort()
q=0
if c[0]+c[1]<=c[a-1]:
print (1,2,a)
else :
print(-1)
| 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 " + str(n))
else:
print(-1) | 7 | PYTHON3 |
for i in range(int(input())):
a=int(input())
b=list(map(int,input().split()))
if b[0]+b[1]>b[a-1]:
print(-1)
else:
print(f'1 2 {a}') | 7 | PYTHON3 |
for item 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 |
t = int(input())
for _ in range(t):
n = int(input())
arr = [int(num) for num in input().split(' ')]
if arr[0]+arr[1]>arr[-1]:
print(-1)
else:
print(1,end=' ')
print(2,end=' ')
print(n) | 7 | PYTHON3 |
T = int(input())
for t in range(T):
N = int(input())
lst = list(map(int, input().split()))
if((lst[0]+lst[1])>lst[N-1]):
print("-1")
else:
print("1 2 ",N) | 7 | PYTHON3 |
a=int(input())
for i in range(a):
b=int(input())
c=input().split()
if int(c[b-1])-(int(c[0])+int(c[1]))>=0:
print(1,2,b)
else:
print(-1) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n=int(input())
li=list(map(int,input().split()))
a=li[0]
b=li[1]
c=a+b
fg=0
d=0
for i in range(2,n):
if(c<=li[i]):
fg=1
d=i+1
break
if fg==0:
print(-1)
else:
print(1,2,d)
| 7 | PYTHON3 |
t = int(input())
for i in range(t):
n = int(input())
ai = list(map(int,input().split()))
if ai[-1] - ai[0] - ai[1] >= 0:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
def triangle(n,a):
b=a[0]+a[1]
for x in range(n):
if a[x]>=b:
print(1,2,x+1)
return
print(-1)
return
t=int(input())
array=[]
for i in range(t):
a=[]
a.append(int(input()))
a.append(list(map(int,input().split(" "))))
array.append(a)
for x in array:
tri... | 7 | PYTHON3 |
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
int mod = 1000000007;
using namespace std;
bool isp(long long x) {
for (long long i = 2; i * i <= x; ++i)
if (x % i == 0) return false;
return true;
}
void pog() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
}
bool sortinrev(const pair<long lon... | 7 | CPP |
t=int(input())
for o in range(t):
n=int(input())
a=list(map(int,input().split()))
x=a[n-1]
y=a[0]
flag=0
for i in range(1,n-1):
if a[i]+y<=x:
flag=1
break
if flag==1:
print(1,i+1,n)
else:
print(-1) | 7 | PYTHON3 |
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, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
from sys import stdin
"""
n=int(stdin.readline().strip())
n,m=map(int,stdin.readline().strip().split())
s=list(map(int,stdin.readline().strip().split()))
s=stdin.readline().strip()
"""
m=int(stdin.readline().strip())
for i in range(m):
n=int(stdin.readline().strip())
s=list(map(int,stdin.readline().strip().spli... | 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 |
import os
import sys
from collections import Counter
from io import BytesIO, IOBase
def main():
input = sys.stdin.readline
for t in range(int(input())):
n =int(input())
a = list(map(int, input().split()))
b=[1,2]
for i in range(2,n):
if a[i]>=a[0]+a[1]:
... | 7 | PYTHON3 |
from math import *
sInt = lambda: int(input())
mInt = lambda: map(int, input().split())
lInt = lambda: list(map(int, input().split()))
t= sInt()
for _ in range(t):
n = sInt()
a = lInt()
if a[0]+a[1]>a[-1]:
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = [int(s) for s in input().split()]
ans = "-1"
if a[0] + a[1] <= a[-1]:
ans = str(1) + " " + str(2) + " " + str(n)
print(ans) | 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 |
#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
long long mod = 1e9 + 7;
const int N = 5e4 + 10;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
long long T, n, m, x, y, z, ans, tem, cnt;
struct node {
long long id, v;
};
node a[N];
int cmp(node a, node b) { return a.v < b.v; }
int... | 7 | CPP |
t = int(input())
arrs = []
for i in range(t):
_ = int(input())
arr = [int(j) for j in input().split()]
arrs.append(arr)
for arr in arrs:
a1 = arr[0]
a2 = arr[1]
a3 = arr[-1]
if a1+a2 > a3:
print(-1)
else:
print(1,2,len(arr))
| 7 | PYTHON3 |
for i in range (int(input())):
n=int(input())
l1=list(map(int,input().split()))
if(l1[0]+l1[1]<=l1[n-1]):
print("1 2 ",n)
else:
print(-1)
| 7 | PYTHON3 |
from collections import defaultdict
t=int(input())
for _ in range(t):
n=int(input())
a=list(map(int,input().split()))
mi=a[0]
mx=a[n-1]
flag=0
for i in range(1,n-1):
if(a[i]<=mx-mi):
print(1,i+1,n)
flag=1
break
if(flag==0):
print(-1)
| 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, 2, n)
else:
print(-1) | 7 | PYTHON3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.