34 lines
800 B
C++
34 lines
800 B
C++
// Sum of Two Values
|
|
|
|
#include<bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
using ll = long long;
|
|
|
|
int main() {
|
|
map<ll, vector<int>> input;
|
|
int n; cin >> n;
|
|
ll x; cin >> x;
|
|
vector<ll> in;
|
|
for (int i{}; i < n; i++) {
|
|
ll a; cin >> a;
|
|
input[a].push_back(i);
|
|
in.push_back(a);
|
|
}
|
|
for (int i{}; i < n; i++) {
|
|
ll target = x - in[i];
|
|
bool flag = target == in[i];
|
|
if (input[target].empty() || (input[target].size() == 1 && flag)) continue;
|
|
else {
|
|
if (flag) {
|
|
cout << i + 1 << " " << input[target][1] + 1<< endl;
|
|
} else {
|
|
cout << i + 1 << " " << input[target][0] + 1<< endl;
|
|
}
|
|
return 0;
|
|
}
|
|
}
|
|
cout << "IMPOSSIBLE" << endl;
|
|
return 0;
|
|
}
|