Skip to content

Instantly share code, notes, and snippets.

@yooniversal
Created August 16, 2020 09:55
Show Gist options
  • Save yooniversal/ec7986bf10ea58ea95cf59e4de21219a to your computer and use it in GitHub Desktop.
Save yooniversal/ec7986bf10ea58ea95cf59e4de21219a to your computer and use it in GitHub Desktop.
A. Bad Triangle
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
#define INF 987654321
typedef long long ll;
int main() {
cin.tie(nullptr);
cout.tie(NULL);
ios_base::sync_with_stdio(false);
int t; cin >> t;
while (t--) {
int n; cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
bool ans = false;
if (a[0] + a[1] <= a[n - 1]) {
cout << "1 2 " << n << '\n';
}
else {
cout << "-1\n";
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment