solution stringlengths 11 983k | difficulty int64 0 21 | language stringclasses 2
values |
|---|---|---|
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 |
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,n)
| 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
ls = list(map(int, input().split()))
if ls[0] + ls[1] > ls[-1]:
print(-1)
else:
print(1, 2, n)
| 7 | PYTHON3 |
T = int(input())
for t in range(T):
n = int(input())
xs = [int(x) for x in input().split()]
# for i in range(len(xs)-2):
# if xs[i]+xs[i+1] >= xs[i+2]:
# print(i+1, i+2, i+3)
# break
# else:
# print(-1)
# lol I thought the prompt was the inverse
if xs[0] +... | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
k = 0
mas = [int(i) for i in input().split()]
for i in range(2, n):
if mas[0] + mas[1] <= mas[i]:
print(1, 2, i+1)
k += 1
break
if k == 0:
print(-1) | 7 | PYTHON3 |
import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
input = stdin.readline
#print = stdout.write
letters = ascii_letters[:26]
for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
first = arr[0]
second = arr[-1]
ca... | 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 |
import math
from collections import Counter,defaultdict
I =lambda:int(input())
M =lambda:map(int,input().split())
LI=lambda:list(map(int,input().split()))
for _ in range(I()):
n=I()
a=LI()
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())
arr = [int(elem) for elem in input().split()]
if arr[0]+arr[1] <= arr[-1]:
print(1, 2, len(arr))
else:
print(-1) | 7 | PYTHON3 |
import math
t=int(input())
for w in range(t):
n=int(input())
l=sorted([int(i) for i in input().split()])
if(l[0]+l[1]>l[-1]):
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
t = int(input())
for i in range(0 ,t):
input()
A = list(map(lambda x: int(x), input().split()))
A.sort()
if A[0]+A[1] <= A[-1]:
print(1, 2, len(A))
else:
print(-1) | 7 | PYTHON3 |
t=int(input())
for _ in range(0,t):
n=int(input())
a=list(map(int,input().split()))
p=0
for i in range(len(a)-1,1,-1):
if a[0]+a[1]<=a[i]:
p=1
break
if p==1:
print(1,2,(i+1))
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: sys.stdin.readline().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, heapp... | 7 | PYTHON3 |
t = int(input())
for i in range(t):
n = int(input())
s = input().split()
a = list(map(int, s))
if a[0] + a[1] > a[len(a)-1]:
print(-1)
else:
print(1, 2, len(a))
| 7 | PYTHON3 |
from sys import stdin
###############################################################
def iinput(): return int(stdin.readline())
def minput(): return map(int, stdin.readline().split())
def linput(): return list(map(int, stdin.readline().split()))
###############################################################
t = iinp... | 7 | PYTHON3 |
import sys
import math
from functools import reduce
import bisect
def getN():
return int(input())
def getNM():
return map(int, input().split())
def getList():
return list(map(int, input().split()))
def input():
return sys.stdin.readline().rstrip()
def index(a, x):
i = bisect.bisect_left(a,... | 7 | PYTHON3 |
def run():
num = int(input())
nums = [int(i) for i in input().split()]
if nums[0] + nums[1] <= nums[-1]:
print(1, 2, num)
else:
print(-1)
n = int(input())
for i in range(n):
run()
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int prmin, mn, mx, n, hh, x, prmini, mni = -1, mxi;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> hh;
prmin = 1000000001;
mn = 1000000001;
mx = -1;
for (int j = 0; j < hh; j++) {
cin >> x;
if (x < mn) {
prmin = mn;... | 7 | CPP |
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()
out = False
i = 0
j = 2
while j < n:
i... | 7 | PYTHON3 |
import sys, collections, math
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()
mod = 1000000007
for _ in range(int(input())):
n = int(input())
arr = get_array(); fl... | 7 | PYTHON3 |
import sys
t = int(sys.stdin.readline())
for _ in range(t):
n = int(sys.stdin.readline())
m = {}
A = list(map(int, sys.stdin.readline().split()))
i = 0
j = n - 2
k = n - 1
f = False
while i < j:
if A[i] + A[j] <= A[k]:
f = True
break
else:
... | 7 | PYTHON3 |
tc=int(input())
for _ in range(tc):
n=int(input())
a=list(map(int,input().split()))
i,j,k=0,1,n-1
if a[i]+a[j]<=a[k]:
print(i+1,j+1,k+1)
else:
print(-1)
| 7 | PYTHON3 |
n = int(input())
for _ in range(n):
a = int(input())
l = list(map(int,input().split()))
if l[0]+l[1]<=l[a-1]:
print(1,2,a,sep = ' ')
else:
print(-1)
| 7 | PYTHON3 |
t=int(input())
for _ in range(t):
n=int(input())
l=list(map(int,input().split()))
flag=0
if(len(l)<=2):
print(-1)
else:
for i in range(n-1):
if(l[i]+l[i+1]<=l[-1]):
flag=1
ans=i+1
ans1=i+2
ans3=n
break
if(flag==0):
print(-1)
else:
print(ans,ans1,ans3) | 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[n-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
import math
def gcd(a,b):
if (b == 0):
return a
return gcd(b, a%b)
def lcm(a,b):
return (a*b) / gcd(a,b)
def bs(arr, l, r, x):
while l <= r:
mid = l + (r - l)//2;
if(arr[mid]==x):
return arr[mid]
elif(arr[mid]<x):
l = mid + 1
... | 7 | PYTHON3 |
for _ in range(int(input())):
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()))
if A[0]+A[1] <= A[n-1]:
print(1, 2, n)
else:
print(-1) | 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
if l[-1]>=l[0]+l[1]:
print(1,2,n)
else:
print(-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, i, j, k;
cin >> n;
int a[n];
vector<pair<int, int>> v;
for (i = 0; i < n; i++) {
cin >> a[i];
v.push_back({a[i], i... | 7 | CPP |
import math
from decimal import Decimal
import heapq
import copy
import heapq
from collections import deque
from collections import defaultdict
MOD = 1000000007
def na():
n = int(input())
b = [int(x) for x in input().split()]
return n,b
def nab():
n = int(input())
b = [int(x) for x in input().split()]
c = [in... | 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 |
for test in range(int(input())):
n = int(input())
arr = list(map(int,input().split()))
if arr[0] + arr[1] > arr[-1]:
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 14 20:14:36 2020
@author: sachd
"""
t=int(input())
for i in range(t):
n=int(input())
s=input().split()
ls=[]
for j in range(len(s)):
ls.append(int(s[j]))
c=ls[n-1]
a=ls[0]
b=ls[1]
if a+b>c:
print(-1)
else:
print... | 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
s = a[0] + a[1]
# i = 2
f = 0
for i in range(2, n):
if a[i] >= s:
print(1, 2, i + 1)
f = 1
break
if f == 0:
print(-1) | 7 | PYTHON3 |
import sys #another one
inp=sys.stdin.buffer.readline
read=lambda: list(map(int,inp().split()))
input=lambda : inp().decode().strip()
_T_,=read()
for _t_ in range(_T_):
n,=read()
a=read()
if a[0]+a[1]>a[n-1]:
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
import os
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())
def solve():
n = int(input())
a = list(map(int, input().split()))
#print(a[-1])
if(a[0] + a[1] <= a[-1]):
print("%d %d %d" % (1, 2, n))
else:
print(-1)
for t in range(T):
solve()
| 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
a=list(map(int,input().split()))
c=1
if a[-1]>=a[0]+a[1]:
print(1,2,n)
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, nums):
if nums[0] + nums[1] <= nums[len(nums)-1]:
print(1, 2, len(nums))
... | 7 | PYTHON3 |
n=int(input())
for _ in range(n):
m = int(input())
a=list(map(int,input().split()))
if a[0]+a[1]<=a[-1]:
print(1,2,m)
else:
print(-1) | 7 | PYTHON3 |
t = int(input())
for case in range(t):
n = int(input())
a = [int(s) for s in input().split(' ')]
if a[-1] >= a[0] + a[1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
t = int(input())
for i in range(t):
s = int(input())
arr = list(map(int, input().split()))
if ((arr[0]+arr[1])<=arr[-1]):
print(1,2,s)
else:
print("-1")
| 7 | PYTHON3 |
import collections
def solve(lst):
if len(lst) < 3:
return -1
if lst[0] + lst[1] <= lst[len(lst)-1]:
return str(1) + " "+str(2)+ " " +(str(len(lst)))
return -1
def sort(key):
return key[0]
ans=[]
n = int(input())
for i in range(n):
k=int(input())
lst= list(map(int,input().split()))
ans.append(solve(lst))
f... | 7 | PYTHON3 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
try:
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,2,n)
else:
print(-1)
t = t-1
except EOFError:
print(" ")
# In[... | 7 | PYTHON3 |
import sys
n = int(sys.stdin.readline())
for _ in range(n):
m = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
if arr[0]+arr[1] <= arr[-1]:
print(f"1 2 {len(arr)}")
else:
print("-1") | 7 | PYTHON3 |
import bisect
def multiple_input(): return map(int, input().split())
def list_input(): return list(map(int, input().split()))
for _ in range(int(input())):
n = int(input())
a = list_input()
s = a[0] + a[1]
x = a[-1]
if s > x:
print(-1)
else:
print(1, 2, n) | 7 | PYTHON3 |
def call():
n=int(input())
l=[int(x) for x in input().split()]
if(l[0]+l[1]>l[-1]):
print(-1)
else:
print(1,2,n)
for _ in range(int(input())):
call() | 7 | PYTHON3 |
def bad_triangle(n, a):
if(len(a)<3):
return -1
if(a[-1]<a[0]+a[1]):
return -1
else:
return [1, 2, n]
test = int(input())
for i in range(test):
n = int(input())
a = list(map(int, input().split()))
ans = bad_triangle(n, a)
if(ans==-1):
print(-1)
else:
... | 7 | PYTHON3 |
from sys import stdin,stdout
from collections import defaultdict
input=lambda:stdin.readline().strip()
for _ in range(int(input())):
n=int(input())
lst=list(map(int,input().split()))
sum1=lst[0]+lst[1]
if sum1<=lst[-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
def solver(arr):
k = len(arr)-1
if arr[0]+arr[1]<=arr[k]:
return [1,2,k+1]
else:
return [-1]
for t in range(int(input())):
_ = int(input())
arr = list(map(int,input().split()))
for i in solver(arr):
print(i,end=' ')
print() | 7 | PYTHON3 |
T = int(input())
for _ in range(T):
N = int(input())
A = list(map(int,input().split()))
a,b,c = A[0],A[1],A[-1]
if a+b <= c:
print(1,2,N)
else:
print(-1)
| 7 | PYTHON3 |
def fun(a, n):
if a[0] + a[1] <= a[-1]:
return [1, 2, n]
return [-1]
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
print(*fun(a,n))
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, x, a = 0, b = -1;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
if (i == 0 || i == 1) a += x;
if (i == n - 1 && x >= a) b = i + 1;
}
if (b == -1)
cout << -1 << "\n";
... | 7 | CPP |
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, n)
else:
print(-1) | 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
i = n-3
while i>=0 and a[i]+a[i+1]>a[n-1]:
i-=1
if i==-1:
print(-1)
else:
print(i+1,i+2,n)
| 7 | PYTHON3 |
from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
n = int(inp())
a = [int(x) for x in inp().split()]
flag = False
for i in range(2, n):
if a[i] >= a[0] + a[1]:
print(1, 2, i+1)
flag = True
break
if not flag:
... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
const int N = 5e4 + 5;
long long a[N];
void solve() {
long long n, i;
cin >> n;
for (i = 0; i < n; i++) cin >> a[i];
long long x, y, z;
x = a[0];
y = a[1];
z = a[n - 1];
if (x + y <= z) {
cout << "1 2 " << n << '\n';
return;
}
cout << "-1\n";
}
i... | 7 | CPP |
numCases=int(input())
cases=[]
values=[]
for i in range(numCases):
cases.append(input())
values.append(list(map(int, input().split(" "))))
ret=[]
for x in values:
if (x[0]+x[1]>x[-1]):
ret.append("-1")
else:
ret.append([1,2,x.index(x[-1])+1])
for i in ret:
k=[]
if(i!="-1"):
... | 7 | PYTHON3 |
def solve(arr):
ans = []
s = arr[0]+arr[1]
if s <= arr[-1]:
print(1,2,len(arr))
else:
print(-1)
t = int(input())
for i in range(t):
input()
solve(list(map(int, input().split()))) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t-- > 0) {
int n;
cin >> n;
vector<int> a(n);
for (int& v : a) cin >> v;
if (a[0] + a[1] > a[n - 1])
cout << "-1\n";
else
cout << "1 2 " <<... | 7 | CPP |
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 |
from sys import stdin,stdout
# stdin = open("input.txt","r")
# stdout = open("output.txt","w")
t = int(stdin.readline().strip())
for _ in range(t):
n = int(stdin.readline().strip())
narr = list(map(int,stdin.readline().strip().split(' ')))
if n==3:
arr=narr
if arr[0]+arr[1]<=arr[2]:
stdout.write(str(1)+"... | 7 | PYTHON3 |
t=int(input())
for _ in range(t):
n=int(input())
arr=input().split()
for i in range(n):
arr[i]=int(arr[i])
if arr[0]+arr[1]<=arr[-1]:
print("1 2 "+str(n))
else:
print("-1") | 7 | PYTHON3 |
from bisect import bisect_left, bisect_right
from itertools import combinations
from itertools import permutations
from bisect import bisect_left
from math import ceil
from math import radians
from heapq import heapify, heappush, heappop
import bisect
from math import pi
from collections import deque
from math import ... | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int,input().split()))
find = False
x = a[0]
z = a[-1]
for i in range(1,n-1):
y = a[i]
if x + y <= z:
find = True
break
if find:
print(1,i+1,n)
else:
print(-1) | 7 | PYTHON3 |
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
f... | 7 | PYTHON3 |
import sys
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda: list(map(int, input().strip().split()))
# sys.setrecursionlimit(200000)
# MOD = 10**9... | 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
arr=list(map(int,input().split()))
if arr[0]+arr[1]<=arr[-1]:
print("1 2 "+str(n))
else:
print("-1") | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int,input().split()))
a.sort()
if a[0]+a[1] > a[n-1] :
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
i = 2
while(i < n):
if(a[i] >= a[0]+a[1]): break
i += 1
if i == n: print(-1)
else: print(1,2,i+1)
| 7 | PYTHON3 |
#Problem F Shreyansh
from math import *
t=int(input())
while t:
t=t-1
#n,m=map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
s=a[0]+a[1]
flag=1
for i in range(2,n):
if s<=a[i]:
print(1,2,i+1)
flag=0
break
if flag:
... | 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())
*a, = map(int, input().split())
if a[-1] >= a[0] + a[1]:
print(1, 2, n)
else:
print(-1) | 7 | PYTHON3 |
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
# from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
long long int isprime[1000001];
void sieve() {
long long int i, j, k;
isprime[0] = isprime[1] = 1;
for (i = 2; i <= sqrt(1000000); i++) {
if (!isprime[i]) {
for (j = 2 * i; j <= 1000000; j += i) {
isprime[j] = 1;
}
}
}
}
long long int mod... | 7 | CPP |
from fractions import Fraction
from collections import defaultdict
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
if (a[0] + a[1] <= a[n - 1]) {
cout << 1 << ' ' << 2 <<... | 7 | CPP |
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
if a[n-1]<a[1]+a[0]:
print('-1')
else:
for i in range(2, n):
if a[i]>=a[0]+a[1]:
print('1 2 '+str(i+1))
break | 7 | PYTHON3 |
for _ in range (int(input())):
n=int(input())
a=list(map(int,input().split()))
a1,a2,a3=a[0],a[1],a[-1]
if a1+a2>a3:
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
if (a[0] + a[1] > a[n - 1]) {
printf("-1");
printf("\n");
} else {
printf("1");
... | 7 | CPP |
tc = int(input())
for _ in range(tc):
n = int(input())
arr = list(map(int, input().split()))
A,B = arr[0], arr[1]
f = 1
for i in range(2, n):
C = arr[i]
if(A+B <= C or B + C <= A or C + A <= B):
print(1, 2, i+1)
f = 0
break
if(f):
print(-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 ar[n + 1];
for (long long int i = 1; i <= n; i++) cin >> ar[i];
long long int x = ar[1], y = ar[2], z = ar[n];
if ((x + y) <= z || (y + z) <= x || (z + x) <= y... | 7 | CPP |
t = int(input())
for _ in range(t):
n = int(input())
lol=[int(n) for n in input().split()]
z=lol.copy()
z.sort()
if(z[0] + z[1] <=z[-1]):
#if(z[0]==z[1]):
print(1,2,n)
'''print(lol.index(z[0]),end=' ')
lol.remove(z[0])
print(lol.index(z[1]),end=' ... | 7 | PYTHON3 |
t=int(input())
for _ in range(t):
n=int(input())
ls=list(map(int,input().split()))
ls.sort()
if ls[0]+ls[1]<=ls[-1]:
print("1 2",n)
else:
print("-1") | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
long long int n;
long long int ar[50009];
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> ar[i];
}
if ((ar[1] + ar[2]) > ar[n]) {... | 7 | CPP |
import sys
input=sys.stdin.buffer.readline
#arr[i]+arr[j]!=arr[k]
t=int(input())
for _ in range(t):
n=int(input())
arr=[int(x) for x in input().split()]
if arr[0]+arr[1]<=arr[n-1]:
print('{} {} {}'.format(1,2,n))
else:
print(-1) | 7 | PYTHON3 |
def main():
for i in range(int(input())):
n = int(input())
arr = list(map(int,input().split()))
if arr[n-1]>=arr[0]+arr[1]:
print('1 2 {}'.format(n))
else:
print(-1)
if __name__ == "__main__":
main() | 7 | PYTHON3 |
for t in range(int(input())):
num=int(input())
arr=list(map(int,input().split()))
if arr[0]+arr[1]>arr[num-1]:
print(-1)
else:
print(1,2,num)
| 7 | PYTHON3 |
t = int(input())
for test in range(0, t):
n = int(input())
sides = list(map(int, input().split(' ')))
if sides[0] + sides[1] <= sides[n-1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long C(int n, int r) {
if (r > n) return 0;
if (r > n - r) r = n - r;
long long ans = 1;
int i;
for (i = 1; i <= r; i++) {
ans *= n - r + i;
ans /= i;
}
return ans;
}
vector<long long> sieve(long long n) {
vector<long lo... | 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long int n;
long long int a[50007];
cin >> 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 << -1 << endl;
}
int main() {
long long int t;
... | 7 | CPP |
t=int(input())
for _ in range(t):
n=int(input())
arr=list(map(int,input().split()))
if arr[0]+arr[1]>arr[-1]:
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = input()
a = [int(x) for x in input().split()]
if a[-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()))
if a[0]+a[1]<=a[n-1]:
print("1 2 ",n,sep="")
else:
print("-1") | 7 | PYTHON3 |
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
T = ni()
for _ in range(T):
n = ni()
a = nl()
if a[0] + a[1]... | 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
s=l[0]+l[1]
flag=0
for i in range(2,n):
if(s<=l[i]):
print("1","2",i+1)
flag=1
break
if(flag==0):
print("-1") | 7 | PYTHON3 |
t = int(input())
for i in range(t):
n = int(input())
pole = input().split()
for j in range(n):
pole[j] = int(pole[j])
hran = pole[0]+pole[1]
pravda = False
for j in range(n):
if pole[j] >= hran:
pravda = True
break
if pravda == True:
print(1,2,... | 7 | PYTHON3 |
t=int(input())
for i in range(t):
n=int(input())
lst=list(map(int,input().split()))
m=max(lst)
index=lst.index(m)
flag=0
lst.pop(index)
for i in range(len(lst)-1):
if(lst[i]+lst[i+1]<=m):
print(i+1,i+2,index+1)
flag=1
break
if(flag==0):
... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, a[100000];
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
if (a[0] + a[1] <= a[n - 1]) {
cout << 0 + 1 << " " << 1 + 1 << " " << n << "\n";
} else
cout << "-1\n";
}
}
| 7 | CPP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.