solution stringlengths 11 983k | difficulty int64 0 21 | language stringclasses 2
values |
|---|---|---|
# A. Плохой треугольник
t = int(input())
arrays = []
for i in range(t):
n = int(input())
a = list(map(int, input().split()))
arrays.append(a)
def func(arr: list):
if arr[0] + arr[1] > arr[len(arr) - 1]:
print(-1)
return
else:
print(f'1 2 {len(arr)}')
return
# ... | 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, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
# cook your dish here
t=int(input())
for _ in range(t):
n=int(input())
a=list(map(int,input().split()))
k=a[0]
m=a[1]
if a[n-1]>=k+m:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
t=int(input())
for o in range(0,t):
n = int(input())
arr = list(map(int,input().split(" ")))
sum = arr[0] + arr[1]
flag = 0
for i in range(2,n):
if(arr[i] >= sum):
print("{} {} {}".format(1, 2, i + 1))
flag = 1
break
if(flag == 0):
print("-1") | 7 | PYTHON3 |
t = int(input())
while t > 0:
n = int(input())
lst = list(map(int, input().split()))
if lst[0] + lst[1] <= lst[-1]:
print(1,2,n)
else:
print(-1)
t-=1
| 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())
a=list(map(int,input().split()))
if a[-1]<a[0]+a[1]:
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
if __name__=="__main__":
t=int(input())
while(t):
t-=1
n=int(input())
li=list(map(int,input().split()))
i=0
j=1
k=len(li)-1
flag=0
while(i<len(li)-2):
while(j<len(li)-1):
while(j<k):
if li[i]+li[j]>li... | 7 | PYTHON3 |
ans = []
for t in range(int(input())):
n = int(input())
A = list(map(int, input().split()))
if A[0] + A[1] <= A[-1]: ans += [[1, 2, n]]
else: ans += [[-1]]
[print(*x) for x in ans] | 7 | PYTHON3 |
for i in range(int(input())):
n = int(input())
ar = list(map(int,input().split()))
if ar[0]+ar[1]>ar[-1]:
print("-1")
else:
print("1","2",n) | 7 | PYTHON3 |
T = int(input())
for _ in range(T):
length = int(input())
a = list(map(int, input().split()))
x = a[0]
y = a[1]
z = a[-1]
if (x+y <= z):
print(1, 2, len(a))
else:
print(-1) | 7 | PYTHON3 |
for p in range(int(input())):
n=int(input())
x=[int(x) for x in input().split()]
i,j,k=0,1,n-1
a,b,c=x[i],x[j],x[k]
if (a+b)>c:
print(-1)
else:
print(i+1,j+1,k+1) | 7 | PYTHON3 |
z = (int(input()))
for i in range(z):
n = int(input())
arr = list(map(int,input().split()))
if arr[0] + arr[1] <= arr[n-1]:
print('1 2',n)
else:
print('-1')
| 7 | PYTHON3 |
t=int(input())
for i in range(t):
n=int(input())
b=list(map(int,input().split()))
if (b[0]+b[1])<=b[-1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
t=int(input())
for i in range(t):
n=int(input())
l=[int(i) for i in input().split()]
print(1,2,n) if l[0]+l[1]<=l[-1] else print(-1) | 7 | PYTHON3 |
t=int(input())
for i in range(0,t):
n = int(input())
l = list(map(int,input().split()))
a=l[0]
c=l[n-1]
b=False
for i in range(1,n-1):
if(a+l[i] <=c):
b=i+1
break
if(b):
print("1", b, n)
else:
print(-1) | 7 | PYTHON3 |
for _ in range(int(input())):
N=int(input())
A=list(map(int,input().split()))
t=A[0]+A[1]
temp=0
for i in range(2,N):
if(A[i]>=t):
temp=1
print(1,2,i+1)
break
if(temp==0):
print(-1) | 7 | PYTHON3 |
def isTriangle(a, b, c):
if a+b <= c or a+c <= b or b+c <= a:
return False
return True
t = int(input())
while t != 0:
t -= 1
n = int(input())
arr = [int(x) for x in input().split()]
if not isTriangle(arr[0], arr[1], arr[-1]):
print ("1 2", n)
else:
print(-1)
| 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 |
from collections import Counter
import sys
sys.setrecursionlimit(10 ** 6)
mod = 1000000007
inf = int(1e18)
dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]
def inverse(a):
return pow(a, -1, mod)
def solve():
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[-1]:
print(1, 2, n)... | 7 | PYTHON3 |
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase
"""def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)"""
# def pw(a,b):
# result=1
# while(b>0):
# if(b%2==1): result*=a
# a*=a
# ... | 7 | PYTHON3 |
t = int(input())
i = 0
while i < t:
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[len(a) - 1]:
print(1, 2, len(a))
else:
print(-1)
i += 1 | 7 | PYTHON3 |
test = int(input().strip())
for _ in range(test):
n = int(input().strip())
arr = list(map(int, input().strip().split(" ")))
i1, i2, i3 = 0, 1, n-1
if arr[i1] + arr[i2] <= arr[i3]:
print(i1 + 1, i2 + 1, i3 + 1)
else:
print(-1)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
vector<int> ar[1000001];
int vis[1000001];
int freq1[26];
int freq2[26];
bool checkPrime(int n) {
if (n <= 1) return false;
if (n <= 3) return true;
if (n % 2 == 0 || n % 3 == 0) return false;
for (int i = 5; i * i <= n; i = i + 6)
if (n % i == 0 || n % (i + 2) ... | 7 | CPP |
t = int(input())
for _ in range(t):
l = int(input())
a = list(map(int, input().strip().split()))
if l < 3:
print(-1)
continue
if a[0]+a[1] <= a[l-1]:
print("{0} {1} {2}".format(1, 2, l))
else:
print(-1)
| 7 | PYTHON3 |
from sys import stdin
def readline():
return stdin.readline()
tests = int(readline())
def solve(n, a):
i = 0
j = 1
k = n - 1
if a[k] >= a[i] + a[j] or a[i] >= a[k] + a[j] or a[j] >= a[i] + a[k]:
return str(i + 1) + ' ' + str(j + 1) + ' ' + str(k + 1)
return -1
for t in range(0, test... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, a[100000];
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n;
for (int j = 0; j < n; j++) {
cin >> a[j];
}
if (a[0] + a[1] <= a[n - 1])
cout << 1 << ' ' << 2 << ' ' << n << endl;
else
cout << -1 << endl;
}
... | 7 | CPP |
t=int(input())
for _ in range(t):
n=int(input())
ar=[int(i) for i in input().strip().split(" ")]
a=ar[0]
b=ar[1]
c=ar[-1]
if a+b>c:
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
lst = list(map(int, input().split()))
if lst[0]+lst[1]<=lst[-1]:
print("1 2 " + str(n))
else:
print(-1)
| 7 | PYTHON3 |
def solve():
n = int(input())
a = list(map(int, input().split()))
if a[0] + a[1] <= a[-1]:
print(1, 2, n)
return
print(-1)
for i in range(int(input())):
solve() | 7 | PYTHON3 |
import sys
#input=sys.stdin.buffer.readline
t=int(input())
while t:
t-=1
n=int(input())
a=list(map(int,input().split()))
k=a[0]+a[1]
c=0
for i in range(2,n):
if k<=a[i]:
c=1
break
if c==1:
print(1,2,i+1)
else:
print(-1) | 7 | PYTHON3 |
t=int(input())
while t>0:
t-=1
n=int(input())
a=list(map(int,input().split()))
if a[0]+a[1]<=a[-1]:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
from sys import stdin,stdout
from itertools import combinations
from collections import defaultdict,Counter
import math
def listIn():
return list((map(int,stdin.readline().strip().split())))
def stringListIn():
return([x for x in stdin.readline().split()])
def intIn():
return (int(stdin.readline())... | 7 | PYTHON3 |
# begin FastIO
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 typ=int: typ(rdln())
inar=lambda typ=int: [typ(x) for x in rdln().split()]
inst=lambda: rdln().strip().decode()
# end FastIO
# begin DEBUG
_DEBUG=0
def debug(*args):
... | 7 | PYTHON3 |
# def checkKey(dict, key):
# if key in dict:
# return True
# return False
# def helper(s):
# l=len(s)
# if (l==1):
# l=[]
# l.append(s)
# return l
# ch=s[0]
# recresult=helper(s[1:])
# myresult=[]
# myresult.append(ch)
# for st in recresult:
# myresult.append(st)
# ts=ch+st
# myresult.append(ts)... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n;
cin >> n;
long long a[n + 1];
for (int i = 1; i <= n; i++) cin >> a[i];
if (a[1] + a[2] <= a[n]) {
cout << "1"
<< " "
<< "2"
<< " " << n << endl;
} ... | 7 | CPP |
for u in range(int(input())):
n = int(input())
x = [int(w) for w in input().split()]
if x[0] + x[1] > x[-1]:
print(-1)
else:
print(1, 2, n) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int oo = INT_MAX;
int t, n;
int a[N];
int main() {
cin >> t;
while (t--) {
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d", a + i);
if (a[0] + a[1] <= a[n - 1])
printf("%d %d %d\n", 1, 2, n);
else
puts("-1"... | 7 | CPP |
t = int(input())
cnt = 0
while (cnt < t):
cnt += 1
n = int(input())
flag = False
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())
li = [int(x) for x in input().split()]
if li[0]+li[1]<=li[-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 a[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;
}
return 0;
}
| 7 | CPP |
import math
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() {
int i, j, k, t, n;
cin >> t;
while (t--) {
cin >> n;
int arr[n];
for (i = 0; i < n; i++) {
cin >> arr[i];
}
if ((arr[0] + arr[1] <= arr[n - 1]) || (arr[1] + arr[n - 1] <= arr[0]) ||
(arr[0] + arr[n - 1] <= arr[1])) {
... | 7 | CPP |
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 |
for i in range(int(input())):
n = int(input())
array = list(map(int, input().split()))
if(array[0] + array[1] <= array[-1]):
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
for i in [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 |
from sys import stdin
for _ in range(int(stdin.readline())):
n = int(stdin.readline())
a = list(map(int, stdin.readline().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 s[50001];
signed main() {
int t;
scanf("%d", &t);
while (t--) {
int n;
scanf("%d", &n);
for (int i = 0; i < (n); i++) {
scanf("%d", &s[i]);
}
for (int i = 1; i < n - 1; i++) {
if (s[0] + s[i] <= s[n - 1]) {
printf("%d %d %d\... | 7 | CPP |
t = int(input())
for i in range(t):
n = int(input())
a = [int(s) for s in input().split()]
sum = a[0] + a[1]
flag = 0
j = 2
while(flag == 0):
if(sum <= a[j]):
print(1, 2, j+1)
flag = 1
if(j == n-1 and flag == 0):
print(-1)
flag = 1
... | 7 | PYTHON3 |
t = int(input())
for x in range(t):
n = int(input())
a = list(map(int, input().split()))
b = list(a)
max1 = max(a)
a.remove(max1)
min1 = min(a)
a.remove(min1)
min2 = min(a)
a.remove(min2)
if (max1 >= (min1 + min2)):
print(1, 2, len(b))
continue
a = b
max1 ... | 7 | PYTHON3 |
t = int(input())
for _ in range(t):
n = int(input())
num = list(map(int, input().split()))
if num[0] + num[1] > num[n-1]:
print("-1")
else:
print("{} {} {}".format(1, 2, n))
| 7 | PYTHON3 |
for _ in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
a=l[0]
b=l[1]
c=l[len(l)-1]
if (a+b>c and b+c>a and c+a>b)==False:
print(1,2,n)
else:
print(-1) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int a[50005];
int main() {
int t, n;
cin >> t;
while (t--) {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
if (a[1] + a[2] <= a[n]) {
printf("1 2 %d\n", n);
} else {
puts("-1");
}
}
}
| 7 | CPP |
import sys
from collections import defaultdict as dd
from collections import deque
from functools import *
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from math import *
from itertools import permutations
def eprint(*args):
print(*args, file=sys.stderr)
zz=1
... | 7 | PYTHON3 |
test=int(input())
for t in range(test):
n=int(input())
a=list(map(int,input().split()))
if a[0]+a[1]>a[n-1]:
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
import sys
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')
import math
import collections
from sys import stdin,stdout,setrecursionlimit
import bisect as bs
setrecursionlimit(2**20)
M = 10**9+7
T = int(stdin.readline())
# T = 1
for _ in range(T):
n = int(stdin.readline())
# ... | 7 | PYTHON3 |
from sys import stdin,stdout
for _ in range(int(stdin.readline())):
n=int(stdin.readline())
# =map(int,stdin.readline().split())
a=list(map(int,stdin.readline().split()))
x=a[0];y=a[1];z=a[-1]
if x+y>z and y+z>x and x+z>y:
print(-1)
continue
print(1,2,n) | 7 | PYTHON3 |
t = int(input())
while t:
t-=1
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(T):
input()
l = list(map(int,input().split()))
for i in range(len(l)):
l[i] = (l[i], i)
l.sort()
if l[0][0] + l[1][0] <= l[-1][0]:
print(l[0][1] + 1, l[1][1] + 1, l[-1][1] + 1)
else:
print(-1)
| 7 | PYTHON3 |
a=int(input())
for i in range(0,a):
b=int(input())
arr=list(map(int,input().split()))
if(arr[0]+arr[1]>arr[len(arr)-1]):
print(-1)
else:
print(1,2,len(arr)) | 7 | PYTHON3 |
t=int(input())
for castle in range(t):
n=int(input())
ls=list(map(int,input().split()))
a,b,c=ls[0],ls[1],ls[-1]
if a+b>c:
print(-1)
else:
print(*[1,2,n]) | 7 | PYTHON3 |
for s in[*open(0)][2::2]:
x,y,*a,z=map(int,s.split())
print(*([1,2,len(a)+3],[-1])[x+y>z]) | 7 | PYTHON3 |
def main():
t = int(input())
for case in range(t):
n = int(input())
A = [int(x) for x in input().split()]
flag = False
for i in range(n-2):
last = n-1
for rt in range(n-i-2):
last = n-1 - rt
if(A[i] + A[i+1] > A[last]):
... | 7 | PYTHON3 |
case=int(input())
while case!=0:
n=int(input())
a=list(map(int,input().split()))
chk=False
i=0
for i in range(n-2):
if a[i]+a[i+1]<=a[n-1]:
print("1","2",n)
chk=True
break
if chk==False:
print("-1")
case-=1
| 7 | PYTHON3 |
## necessary imports
import sys
input = sys.stdin.readline
from bisect import bisect_left;
from bisect import bisect_right;
from math import ceil, factorial;
def ceil(x):
if x != int(x):
x = int(x) + 1;
return x;
# swap_array function
def swaparr(arr, a,b):
temp = arr[a];
arr[a] = arr[b];... | 7 | PYTHON3 |
from sys import stdin
input = lambda : stdin.readline().strip()
for _ in range(int(input())):
n = int(input())
a = list(map(int,input().split()))
r = range(1,n+1)
a.insert(0,n-1)
ans = False
x = a[1]
y = a[2]
for k in range(2,n+1):
if(x+y<=a[k]):
print(1,2,k)
... | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int tc = 1; tc <= t; tc++) {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++) cin >> v[i];
int i = 0, j = 1, k = n - 1;
if (v[i] + v[j] > v[k])
cout << -1 << endl;
else {
cout << ... | 7 | CPP |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int p = 0; p < t; p++) {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
int flag = 0;
int ans[3];
for (int i = 0; i < n - 2; i++) {
int temp;
temp = a[i] + a[i + 1];
... | 7 | CPP |
t=int(input())
for _ in range(t):
n=int(input())
a=list(map(int,input().split()))
flag=0
for i in range(n-1):
x=a[i]
y=a[i+1]
if(a[-1]>=x+y):
x=i+1
y=i+2
flag=1
break
if(flag==1):
print(x,y,n)
else:
pri... | 7 | PYTHON3 |
t=int(input())
for count in range(t):
n=int(input())
a=list(map(int,input().split()))
if a[0]+a[1]>a[n-1]:
print(-1)
else:
print(1,2,n)
| 7 | PYTHON3 |
t = int(input())
for i in range(t):
n = int(input())
a = [int(x) for x in input().split()]
if a[0]+a[1] > a[n-1]:
print(-1)
else:
print(1,2,n) | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 gen(time(0));
void setIO(string name = "") {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
}
int main() {
setIO();
int t, n, x;
cin >> t;
for (int j = 0; j < t; j++) {
cin >> n;
vector<int> a(n);
for (int i = 0; i ... | 7 | CPP |
t = int(input(""))
for i in range(t):
n = int(input(""))
arr = input().split(" ")
if int(arr[0])+int(arr[1])<=int(arr[-1]):
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
test_cases = int(input())
for tests in range(0, test_cases):
n = int(input())
l = list(map(int, input().split()))
if l[0] + l[1] <= l[n - 1]:
print(f"1 2 {n}")
else:
print(-1)
| 7 | PYTHON3 |
t=int(input())
for i in range(t):
n=int(input())
a=list(map(int,input().split()))
if(a[0]+a[1]<=a[-1]):
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
template <class T>
bool mini(T &a, T b) {
return a > b ? (a = b, true) : false;
}
template <class T>
bool maxi(T &a, T b) {
return a < b ? (a = b, true) : false;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.precision(10);
cout << fixed;
... | 7 | CPP |
for _ in range(int(input())):
n=int(input())
list1=[int(x) for x in input().split()]
val1=list1[0]+list1[1]
if val1<=list1[n-1]:
print(1,2,n)
else:
print(-1)
| 7 | PYTHON3 |
import sys
max_int = 1000000001 # 10^9+1
min_int = -max_int
t = int(input())
for _t in range(t):
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
if a[0] + a[1] <= a[-1]:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
t = int(input())
while t > 0:
n = int(input())
x = list(map(int, input().split()))
arr = list()
arr2 = list()
a = 0
arr = sorted(x)
for i in range(3, n+1):
if arr[i-1] >= (arr[0] + arr[1]):
print(1, 2, i)
a = a + 1
break
if a == 0:
prin... | 7 | PYTHON3 |
# cook your dish here
for x in range(int(input())):
n=int(input())
a=[int(x) for x in input().split()][:n]
c=a[0]+a[1]
d=0
for x in range(2,n):
if(c<=a[x] and n>=3):
print('1 2',x+1)
d=1
break
if(d==0):
print('-1') | 7 | PYTHON3 |
# cook your dish here
def compute_lcm(num1, num2):
if(num1>num2):
num = num1
den = num2
else:
num = num2
den = num1
rem = num % den
while(rem != 0):
num = den
den = rem
rem = num % den
gcd = den
lcm = int(int(num1 * num2)/int(g... | 7 | PYTHON3 |
for _ in range(int(input())):
n = int(input())
x = list(map(int, input().split()))
a = x[0]
b = x[1]
c = x[n-1]
if a+b <= c:
print(1, 2, n)
else:
print(-1)
| 7 | PYTHON3 |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 14 20:10:59 2020
@author: Utkarsh
"""
n=int(input(''))
a=[]
while n>0:
l=int(input(''))
a=list(map(int, input().split(' ')[:l]))
for i in range(0,l):
if a[i]+a[i+1]<=a[l-i-1]:
print( i+1, i+2,l-i)
break
else:
... | 7 | PYTHON3 |
def sol(inp, n):
sm = []
ind = []
po = 0
for i in range(n):
sm.append(inp[i])
ind.append(i+1)
po += 1
if po==2 and sum(sm) <= inp[-1]:
print(*ind, end=" ")
print(n)
return
if sum(sm)>inp[-1]:
sm = []
ind ... | 7 | PYTHON3 |
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 '+str(n))
else:
print(-1)
| 7 | PYTHON3 |
import sys
from collections import Counter
from math import ceil,gcd,log
from bisect import bisect ,bisect_left,bisect_right
input = sys.stdin.readline
def check(a, b, c):
if (a + b <= c) or (a + c <= b) or (b + c <= a) :
return False
else:
return True
def solve(n,arr):
a = arr[0]
b = arr[1]
p... | 7 | PYTHON3 |
t = int(input())
#print("out")
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(-... | 7 | PYTHON3 |
def solution(arr):
a,b,c = arr[0] , arr[1] ,arr[-1]
if a + b > c :
return -1
return 1
for _ in range(int(input())):
n = int(input())
arr = [int(x) for x in input().split()]
ans = solution(arr)
if ans == -1 :
print(-1)
else:
print(ans,ans+1,len(arr)) | 7 | PYTHON3 |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
void test() {
long long n;
cin >> n;
long long a[n];
for (long long i = 0; i < n; i++) cin >> a[i];
if (a[n - 1] >= a[0] + a[1])
cout << 1 << " " << 2 << " " << n << endl;
else
cout << -1... | 7 | CPP |
for _ in range(int(input())):
n=int(input())
a=list(map(int,input().split()))
for i in range(n-2):
for j in range(i+1,n-1):
for k in range(j+1,n):
if a[i]+a[j]>a[k] and a[i]+a[k]>a[j] and a[j]+a[k]>a[i]:
c=1
continue
... | 7 | PYTHON3 |
from sys import stdin,stdout
import bisect
n=int(stdin.readline())
for i in range(n):
ans=0
a=int(stdin.readline())
x=[int(i) for i in stdin.readline().split()]
x.sort()
if x[0]+x[1]>x[-1]:
stdout.write('-1'+'\n')
continue
stdout.write(str(1)+' '+str(2)+' '+str(len(x))+'\n')
| 7 | PYTHON3 |
t = int(input())
while t:
n = int(input())
arr = list(map(int, input().split()))
if arr[0] + arr[1] <= arr[-1]:
print(1, 2, n)
else:
print(-1)
t -= 1
| 7 | PYTHON3 |
import copy
def get_output(array,length):
max=array[-1]
i=0
while(i!=length-2):
sum=array[i]+array[i+1]
if sum<=max:
return i+1,i+2,length
else:
i+=1
return -1
test_cases=int(input())
for i in range(test_cases):
length=int(input())
array=[int(i) for i in input().split()]
res=get_output(array,length)
... | 7 | PYTHON3 |
import sys
input = sys.stdin.readline
T = int(input())
for testcase 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,n) | 7 | PYTHON3 |
def Solution(arr):
if not arr[0] + arr[1] > arr[-1]:
return str(1) + ' ' + str(2) + ' ' + str(len(arr))
else:
return -1
t = int(input())
for _ in range(t):
__ = input()
arr = list(map(int, input().split(' ')))
print(Solution(arr)) | 7 | PYTHON3 |
# fin = open("a.in", "r")
# buf = fin.read()
# fin.close()
import sys
buf = sys.stdin.read()
nowbuf = 0
endbuf = len(buf)
def getint():
global nowbuf
valnow = 0
while buf[nowbuf] < '0' or buf[nowbuf] > '9':
nowbuf += 1
while nowbuf < endbuf and buf[nowbuf] >= '0' and buf[nowbuf] <= '9':
... | 7 | PYTHON3 |
import sys, math, heapq, collections, itertools, bisect
sys.setrecursionlimit(101000)
def solve(n, a):
l1, l2, l3 = a[0], a[1], a[n-1]
if l1+l2 <= l3:
return 1, 2, n
return None, None, None
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
i, j, k... | 7 | PYTHON3 |
t=int(input())
while(t>0):
n=int(input())
A=list(map(int,input().split()))
if A[0]+A[1]<=A[n-1]:
print(1,2,n)
else:
print(-1)
t-=1 | 7 | PYTHON3 |
#include <bits/stdc++.h>
using namespace std;
struct solution {
int t, n{0};
vector<int> a{};
void get_data() { cin >> t; }
void solve() {
while (t--) {
cin >> n;
a.clear();
a.resize(n);
for (auto &el : a) cin >> el;
auto f = a[0];
auto s = a[1];
bool printed = fals... | 7 | CPP |
for _ in range(int(input())):
n = int(input())
arr = list(map(int,input().split()))
p = (arr[0]+arr[1]+arr[n-1])/2
if p > arr[0] and p > arr[1] and p > arr[n-1]:
print(-1)
else:
print("1 2",n) | 7 | PYTHON3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.