#include #include #define MAX (2000000000) using namespace std; int n; int* k; int result[3] = {-1,-1,-1}; bool flg_end = false; bool check_K(int* t){ /*for(int i=0;i<3;i++){ cout << t[i]; } cout << " "; for(int i=0;i<3;i++){ cout << k[t[i]]; }*/ int a,b,c; a = t[0], b = t[1], c = t[2]; if(k[a] < k[b] && k[b] < k[c]) return false; if(k[a] > k[b] && k[b] > k[c]) return false; return true; } bool check(int* t, int len){ // check if able to make K numbers if(len<3) return false; int d = k[t[0]]k[t[i]]*d) return true; } return false; } void solve_3(int* t, int c, int index){ if(flg_end) return; if(c == 3) { if(check(t,3)){ int* tmp = new int[n-3]; int j=0; for(int i=0;i> n; k = new int[n]; for(int i=0;i> k[i]; } int* t; solve_3(t,0,0); if(result[0] == -1) cout << "-1" << endl; else cout << result[0] << " " << result[1] << " " << result[2] << endl; return 0; }