solution stringlengths 11 983k | difficulty int64 0 21 | language stringclasses 2
values |
|---|---|---|
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 |
for _ in range(int(input())):
n=int(input())
ar=list(map(int,input().split()))
count=1
for i in range(2,n):
if ar[i]>=ar[0]+ar[1]:
print(1,2,i+1)
count=0
break
if count==1:
print(-1) | 7 | PYTHON3 |
t=int(input())
for i in range(t):
n=int(input())
a=list(map(int,input().split()))
x=a[0]
y=a[1]
z=a[-1]
c=len(a)
if(x+y>z):
print(-1)
else:
print(1,2,c) | 7 | PYTHON3 |
t=int(input())
## sum of two sides is greater than theird side
## 4 6 9 10 18
for _ in range(t):
n=int(input())
a=[int(x) for x in input().split()]
tr=0
for i in range(0,n-2):
s=a[i]+a[i+1]
if s<=a[n-1]:
b=[i,i+1,n-1]
tr=1
break
if tr==1:
... | 7 | PYTHON3 |
t=int(input())
for _ in range(t):
n=int(input())
a=list(map(int,input().split()))
a.sort()
s=a[0]+a[1]
flag=0
for i in range(2,n):
if a[i]>=s:
flag=1
break
if flag:
print(1,2,i+1)
else:
print(-1) | 7 | PYTHON3 |
test=int(input())
for t in range(0,test):
n=int(input())
lst=[int(x) for x in input().split()]
if lst[n-1]>=(lst[0]+lst[1]):
print(1,2,n)
else :
print(-1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
long long int a[n], b[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
b[i] = a[i];
}
sort(a, a + n);
int d[3... | 7 | CPP |
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq
def ri():
return int(input())
def rl():
return list(map(int, input().split()))
def solve():
n = ri()
A = rl()
L = [[a, i + 1] for i, a in enumerate(A)]
L.sort()
if L[0][0] + L[1][0] <= L[-1... | 7 | PYTHON3 |
for query in range(int(input())):
n=int(input())
b=input().split()
a=[]
for x in range(n):
a.append((int(b[x]),x+1))
a=sorted(a)
if a[0][0]+a[1][0]<=a[n-1][0]:
print(str(a[0][1])+" "+str(a[1][1])+" "+str(a[n-1][1]))
else:
print(-1)
| 7 | PYTHON3 |
# ------------------- fast io --------------------
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.mode or "r" not in file.mode... | 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()]
for i in range(2,n):
if a[i] >= a[0]+a[1]:
print(1,2,i+1)
break
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)
else:
print(1, 2, n)
t -= 1
| 7 | PYTHON3 |
for z 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 |
t = int(input())
sol = []
for i in range(t):
n = int(input())
l = list(map(int, input().split()))
j = l.copy()
x = min(j)
j.remove(x)
y = min(j)
z = max(j)
if x + y <= z:
if x == y:
x = l.index(x) + 1
l.remove(y)
y = l.index(y) + 2
... | 7 | PYTHON3 |
def trian(arr):
if(arr[0]+arr[1]>arr[-1]):
print(-1)
else:
print(1,2,len(arr))
t=int(input())
for i in range(t):
n=int(input())
arr=list(map(int,input().split()))
(trian(arr))
| 7 | PYTHON3 |
t=int(input())
while t!=0:
t-=1
n=int(input())
l=list(map(int,input().split()))
fl=1
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())
lst = [int(c) for c in input().split()]
if lst[0] + lst[1] > lst[-1]:
print(-1)
else:
print(1, 2, n)
| 7 | PYTHON3 |
for t 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 |
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
s = a[0]+a[1]
c = False
for i in range(2,n):
if s<=a[i]:
c = True
break
if c is True:
print(1,2,i+1)
else:
print(-1)
| 7 | PYTHON3 |
t=int(input())
for i in range(t):
n=int(input())
a=list(map(int,input().split()))
c=0
if(a[0]+a[1]>a[n-1]):
c+=1
if(a[n-1]+a[0]>a[1]):
c+=1
if(a[n-1]+a[1]>a[0]):
c+=1
if(c==3):
print("-1")
else:
print(1,2,n)
| 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())
for _ in range(t):
n = int(input())
a = list(map(int,input().split()))
i = 0
k = n-1
f = False
while i+1<n and i+1<k:
j = i+1
while j<k and a[i]+a[j]>a[k]:
k-=1
if j<k and (not a[i]+a[j]>a[k]):
print(i+1,j+1,k+1)
break
i+=1
else:
print(-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
print(i+1,i+2,N)
break
else:
print(-1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
while (t--) {
long lo... | 7 | CPP |
def check(n):
i = 0
mi = n[2]
ma = n[-1]
while i <= len(n)-3:
a = n[i]
b = n[i+1]
c = n[i+2]
if a + b <= ma:
return [i, i+1, len(n)-1]
elif a + b <= c:
return [i, i+1, i+2]
i+=1
return [-1]
for _ in range(int(input())):
... | 7 | PYTHON3 |
for t in range(int(input())):
n = int(input())
nums = list(map(int,input().split()))
a = sorted(nums)
a1 = 0
a2 = 0
a3 = 0
if (a[0] + a[1] <= a[n-1]):
c = 0
for i in range(n):
if (nums[i] == a[0] and a1 == 0):
a1 = 1
c += 1
... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
long long a[n];
for (long long i = 0; i < n; i++) cin >> a[i];
if (a[0] + a[1] <= a[n - 1])
cout << ... | 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 5;
int n, cut, a[sz], dp[sz];
void solve() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
if (a[0] + a[1] <= a[n - 1])
printf("1 2 %d\n", n);
else
puts("-1");
}
int main() {
int t;
cin >> t;
while (t--)... | 7 | CPP |
def nextInt():
return int(input())
def intArr():
arr = input().split(" ")
return [int(x) for x in arr]
t = nextInt()
ans = []
for tt in range(t):
length = nextInt()
a = []
s = intArr()
cur = s.pop()
if cur-s[0] <= 1:
ans.append(-1)
elif cur - (s[0]+s[1]) < 0:
ans.app... | 7 | PYTHON3 |
t = int(input())
def check(a, j):
for i in range(n-1,j,-1):
if arr[i] > a:
return [True,i]
return [False, -1]
while t:
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-=1 | 7 | PYTHON3 |
from sys import stdin, stdout
import math,sys,heapq
from itertools import permutations, combinations
from collections import defaultdict,deque,OrderedDict
from os import path
import bisect as bi
def yes():print('YES')
def no():print('NO')
if (path.exists('input.txt')):
#------------------Sublime-------------------... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
void IO() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
template <typename... T>
void read(T&... args) {
((cin >> args), ...);
}
template <typename... T>
void write(T&&... args) {
((cout << args << " "), ...);
}
int mpow(int, int);
long long int n;
vo... | 7 | CPP |
t = int(input())
for _ in range(t):
n = int(input())
ls = list(map(int, input().split()))
if ls[0] + ls[1] <= ls[-1]:
print(1, 2, n)
else:
print(-1) | 7 | PYTHON3 |
t = int(input())
for _ 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 |
#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
return a > b ? a = b, true : false;
}
template <class T>
bool ckmax(T& a, const T& b) {
return a < b ? a = b, true : false;
}
template <typename T>
struct IsC {
template <typename C>
static char test(typename C::cons... | 7 | CPP |
n = int(input())
for i in range(n):
m = input()
lst1 = list(map(int,input().split()))
lst2 = sorted(lst1)
if lst2[0]+lst2[1]<=lst2[-1]:
x = lst1.index(lst2[0])+1
y = lst1.index(lst2[1])+1
z = lst1.index(lst2[-1])+1
if x==y:
print(f"{x} {y+1} {z}")
else... | 7 | PYTHON3 |
#BINOD
import math
test = int(input())
for t in range(test):
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")
#Binod | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long 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++) cin >> a[i];
sort(a.begin(), a.end());
if (a[0] + a[1] <= a[n - 1])
cout << "1 2 " << n << ... | 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n;
bool possible;
long long a1[100000];
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n;
possible = false;
for (int j = 0; j < n; j++) {
cin >> a1[j];
}
for (int j = 2; j < n; j++) {
if (a1[j] >= a1[0] + a1[1]) ... | 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,n)
else:
print(-1) | 7 | PYTHON3 |
t = int(input())
#for each test cases
for i in range(t):
n=int(input())
q=list(map(int,input().split()))
if (q[0]+q[1]<=q[len(q)-1]):
print("1 2 "+str(len(q)))
else:
print("-1") | 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
if l[0]+l[1]<=l[-1]:
print("1 2 "+str(n))
else:
print(-1) | 7 | PYTHON3 |
T = int(input())
for t 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 |
# Om Namh Shivai
# Jai Shree Ram
# Radhe Krishna
# Jai BajrangBali
# Jai Maa Durga
# Jai Maa Kali
for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
sa= arr
status = 0
result = list()
c = arr[len(arr)-1]
b = arr[0]
a = arr[1]
if(a+b <= c):
i... | 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
arr=[int(i) for i in input().split()]
if arr[0]+arr[1]<=arr[-1]:
print(1,2,len(arr))
else:
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 |
for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
if arr[-1] < arr[0] + arr[1]:
print(-1)
else:
print(1, 2, n)
| 7 | PYTHON3 |
def triangle(A):
n=len(A)
z=A[-1]
x=A[0]
y=A[1]
if x+y>z:
print(-1)
else:
print(1,2,n)
t=int(input())
for i in range(t):
n=int(input())
A=[int(z) for z in input().split()][:n]
triangle(A) | 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;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int a[n + 1];
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
if (a[n] >= a[1] + a[2]) {
cout << 1 << " " << 2 << " " << n << endl;
... | 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
while (t--) {
long long int n, temp = 0;
cin >> n;
vector<long long int> a(n);
for (long long int i = 0; i < n; i++) cin >> a[i];
if (a[0] + a[1] <= a[n... | 7 | CPP |
t=int(input())
for i in range(t):
n,a=int(input()),list(map(int,input().split()))
if(a[0]+a[1]<=a[-1]):
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
import math
from itertools import combinations
from collections import Counter
t = int(input())
for _ in range(t):
n = int(input())
# a,b = map(int, input().split())
a = list(map(int, input().split()))
f = 0
x = [1,2]
for i in range(2,len(a)):
if a[x[0]-1] + a[x[1]-1] <= a[i]:
... | 7 | PYTHON3 |
import sys #another one
inp=sys.stdin.buffer.readline
read=lambda: [int(x) for x in 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 sys
input = sys.stdin.readline
############ ---- Input Functions ---- ############
def inp():
return(int(input()))
def inlt():
return(list(map(int,input().split())))
def insr():
s = input()
return(list(s[:len(s)]))
def invr():
return(map(int,input().split()))
t = inp()
for testcase in ran... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
long long t;
cin >> t;
while (t--) {
long long n, flag = 0;
cin >> n;
long long m[n], a[n], i;
for (int i = 1; i <= n; i++) cin >> m[i];
if (m[1] + m[2] <= m[n])
... | 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
using PII = pair<long long, long long>;
const int maxn = 1e5 + 5;
const long long mod = 1e9 + 7;
int a[maxn];
int main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int T = 1;
cin >> T;
while (T--) {
int n;
cin >> n;
for (int i = 1; i <= n;... | 7 | CPP |
for _ in range(int(input())):
n = int(input())
lis = list(map(int, input().split()))
if lis[0] + lis[1] <= lis[-1]:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
t=int(input())
for j in range(t):
n=int(input())
list1=list(map(int,input().split(" ")))
a=0
b=1
ct=0
for i in range(2,n):
if list1[i]>=list1[a]+list1[b]:
print(a+1,b+1,i+1)
ct+=1
break
if not ct:
print(-1)
| 7 | PYTHON3 |
test_cases = int(input())
for _ in range(test_cases):
n = int(input())
nums = list(map(int, input().split()))
if nums[0]+nums[1] > nums[-1]:
print("-1")
else:
print(1,2,n) | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = input()
lst = list(map(int,input().split()))
if lst[0] + lst[1] > lst[-1]:
print("-1")
else:
print("1 2 " + n) | 7 | PYTHON3 |
test_cases=int(input())
for test_case in range(test_cases):
n=int(input())
a = list(map(int, input().split()))
sum=0
c=0
for i in range(n-2):
sum=a[i]+a[i+1]
if a[-1]>=sum:
c=1
break
sum=0
if c==0:
print('-1')
else:
print(i+1,i+... | 7 | PYTHON3 |
from math import *
from collections import *
from random import *
from decimal import Decimal
from heapq import *
from bisect import *
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**5)
def lis():
return list(map(int,input().split()))
def ma():
return map(int,input().split())
def inp():
return... | 7 | PYTHON3 |
tests = int(input())
for t in range(tests):
length = int(input())
raw = input()
A = list(map(int, raw.split()))
if A[length-1] >= (A[0]+A[1]):
print("1 2", length)
else:
print("-1") | 7 | PYTHON3 |
import sys
input = sys.stdin.readline
for _ in range(int(input())):
n=int(input())
L=list(map(int,input().split()))
flag = 0
for i in range(n-2):
if L[i]+L[i+1]<=L[-1]:
print(i+1,i+2,n)
break
else:
print(-1)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
for (int i = 0; i < T; i++) {
int n;
cin >> n;
vector<int> array;
int a;
for (int j = 0; j < n; j++) {
cin >> a;
array.push_back(a);
}
int max = array[n - 1];
if (array[0] + array[1] <= max) {
... | 7 | CPP |
from sys import stdin
def input(): return stdin.readline().rstrip()
for _ in range(int(input())):
L=int(input())
s=list(map(int,input().split()))
if s[0]+s[1]>s[-1]:
print(-1)
else:
print(1,2,L) | 7 | PYTHON3 |
for i 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 |
t = int(input())
for i in range(t):
n = int(input())
a = list(map(int,input().split()))
m = n-1
l = 1
if a[m]>=a[l-1]+a[l]:
print(l,l+1,m+1)
else:
print(-1)
| 7 | PYTHON3 |
for i in range(int(input())):
n=int(input())
a=[int(num) for num in 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())
arr = list(map(int, input().split()))
s = arr[0] + arr[1]
flag = -1
for i in range(2, n):
if arr[i] >= s:
flag = i+1
break
if flag == - 1:
print(-1)
else:
print(1, 2, flag) | 7 | PYTHON3 |
import sys
input = sys.stdin.readline
I = lambda : list(map(int,input().split()))
m,=I()
while m:
m-=1
n,=I()
arr=I()
a=b=c=0
flag=0
for i in range(n-1,1,-1):
if arr[0]+arr[1]<=arr[i]:
print(1,2,i+1)
flag=1
break
if flag==0:
print(-1)
| 7 | PYTHON3 |
n = int(input())
result = []
for i in range(n):
num = int(input())
l = list(map(int, input().split()))
maximum = max(l)
flag = 0
for i in range(len(l) - 2):
a = l[i]
b = l[i+1]
s = a+b
if s <= maximum:
flag = 1
result.append([i+1, i+2, num])
... | 7 | PYTHON3 |
for _ in range(int(input())):
N=int(input())
array=[int(x) for x in input().split()]
if array[0]+array[1]<=array[-1]:
print(1,2,N)
else:
print(-1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long T;
cin >> T;
while (T--) {
long long n;
cin >> n;
long long a[n + 1];
vector<int> vct;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
bool b = false;
bool flag = false;
int k = 3;
for (int i = 3; i <=... | 7 | CPP |
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 |
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 |
for _ in range(int(input())):
n=int(input())
A=[int(_) for _ in input().split()]
a,b=A[0],A[1]
for _ in range(2,n):
c=A[_]
if (a+b)>c and (b+c)>a and (a+c)>b:
continue
else:
print(1,2,_+1)
break
else:
print(-1) | 7 | PYTHON3 |
# import sys
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
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 |
import sys
import math
from sys import stdin, stdout
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_list(): return list(map(int, sys.stdin.readline().strip().split()))
def get_string(): return sys.stdin.readline().strip()
def main():
for t in range(int(input())):
n=int(input()... | 7 | PYTHON3 |
t = int(input())
ans = []
for i in range(t):
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[-1]:
ans.append([0, 1, len(a)-1])
else:
ans.append(-1)
for i in range(t):
if type(ans[i]) is list:
for j in ans[i]:
print(j+1, end=' ')
pr... | 7 | PYTHON3 |
for _ in range(int(input())) :
n=int(input())
ar=list(map(int,input().split()))
br=ar.copy()
ar.sort()
a=br.index(ar[0])
br[a]=10**9+52
b=br.index(ar[1])
br[b]=10*6-6
if len(ar)<3 :
print(-1)
else :
c=ar[0]+ar[1]
flag=0
ans=0
for i... | 7 | PYTHON3 |
import sys
tc = int(sys.stdin.readline())
for _ in range(tc):
n = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
find = False
if arr[-1] >= arr[0] + arr[1]:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
const long long int inf = LLONG_MAX;
const long long int mod = 1e9 + 7;
const long double pi = acos(-1);
void solution() {
long long int n;
cin >> n;
long long int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
long long int ans = a[0] + a[1];
for (int i = 2; i ... | 7 | CPP |
# -*- coding: utf-8 -*-
"""Untitled20.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1OKbrG27mOdvGhdgzvRm1BawZ7TdpQYBR
"""
t=int(input())
while t>0:
n=int(input())
k=0
list1=list(map(int,input().split(" ")))
e=list1[0]+list1[1]
for a i... | 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,end=" ")
print(2,end=" ")
print(n)
else:
print(-1)
| 7 | PYTHON3 |
t=int(input())
for tt in range(t):
n=int(input())
arr=list(map(int,input().split()))
flag=False
for i in range(n-1):
start=i+2
end=n-1
ss=arr[i]+arr[i+1]
ans=-1
while start<=end:
mid=(start+end)//2
if ss<=arr[mid]:
ans=mid
end=mid-1
# break
else:
start=mid+1
if ans!=-1:
flag=... | 7 | PYTHON3 |
q = int(input())
for _ in range(q):
n = int(input())
A = list(map(int, input().split()))
ref = A[0] + A[1]
ans = 0
for i, a in enumerate(A):
if a >= ref:
ans = i
break
if ans == 0:
print(-1)
else:
print(1, 2, ans + 1) | 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
l = list(map(int, input().split()))
min_sum = l[0] + l[1]
third_index = 0
for i in range(n):
if l [i] >= min_sum:
third_index = i + 1
break
if third_index:
print(1, 2, third_index)
else:
print... | 7 | PYTHON3 |
test_cnt = int(input())
for tn in range(test_cnt):
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 |
query=int(input())
for _ in range(query):
n = int(input())
a = list(map(int, input().split()))
ma = max(a);mi = min(a)
flag=0
for i in range(1, n-1):
if a[0]+a[i]<=a[n-1]:
#As sum of two sides of a trinagle is always greater than the third
flag=1
break
if flag==1:
#Bcz of the array being sorted, if ... | 7 | PYTHON3 |
t=int(input())
for i in range (t):
n=int(input())
a=list(map(int,input().split()))
flag=0
for j in range(n-2) :
if flag==1:
break
for k in range (n-1,j+1,-1):
if a[k] >= a[j]+a[j+1]:
print (j+1,j+2,k+1)
flag=1
bre... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
void CyBerForCe() {
long long n;
cin >> n;
vector<long long> v;
for (long long i = 0; i < n; i++) {
long long a;
cin >> a;
v.push_back(a);
}
long long a = 1, b = 2, c = 0;
for (long long i = 2; i < v.size(); i++) {
if (v[i] >= v[0] + v[1]) {
... | 7 | CPP |
for t in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
l1=l.copy()
l.sort()
if l[0]+l[1]<=l[-1]:
a=0
if l[0]==l[1]:
a+=1
print(l1.index(l[0])+1,l1.index(l[1])+1+a,l1.index(l[-1])+1)
else:
print(-1) | 7 | PYTHON3 |
from bisect import *
for _ in range(int(input())):
n = int(input())
A = list(map(int, input().split()))
a = A[0] + A[1]
if a <= A[-1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import deque
from heapq import heappush,heappop,heapify
mod... | 7 | PYTHON3 |
t = int(input())
for case in range(t):
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 |
for _ in range(int(input())):
n = int(input())
a = [int(v) for v 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() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int arr[n + 1];
for (int i = 1; i <= n; i++) {
cin >> arr[i];
}
if (arr[1] + arr[2] <= arr[n]) {
cout << 1 << " " << 2 << " " << n << endl;
} else {
cout << -1 <... | 7 | CPP |
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
t = 0
for i in range(2, n):
if a[0] + a[1] <= a[i]:
print(1, 2, i + 1)
break
else:
t += 1
if t == n-2:
print(-1) | 7 | PYTHON3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.