#include<iostream>
#include<algorithm>
using namespace std;
void Find(int data[],int n,int s,int* num1,int* num2) {
if (data == NULL || n <= 0) return;
int i = 0,j=n-1;
while (i<j)
{
if (data[i] + data[j] > s) j--;
else if (data[i] + data[j] < s) i++;
else break;
}
*num1 = data[i];
*num2 = data[j];
}
int main() {
int a[6] = {1,2,4,7,11,15};
int n1,n2;
Find(a,6,15,&n1,&n2);
cout<<n1<<endl<<n2<< endl;
return 0;
}