#include <iostream>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define fo(i,start,end) for(ll i=start;i<end;i++)
 
int main(){
	vector<ll>arr =  { 1, 5, 2 ,4 ,1};
	int k = 3;
	ll n =  5; 
	unordered_map<int,int>mp; // store element -> frequency
	fo(j,0,n){
		ll query = k + arr[j];
		if(mp.find(query) != mp.end()){
			//element is present
			cout<<"Pairs are {"<<mp[query]<<","<<j<<"}"<<endl;
			return 0;
	}
	mp[arr[j]] = j;
	}
	return 0;
}