#include
using namespace std;
int main() {
int i,j,k,m,n;
cin>>n;
int a[n];
for(i=0;i<n;i++)
cin>>a[i];
int target;
cin>>target;
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]+a[j]== target)
{
cout<<a[i]<<" and "<<a[j];
cout<<endl;
}
}
}
return 0;
}
2 test cases failed, where it gone wrong
@anujsharmabadboy u have to print the pairs in increasing order
if its cleared dont forget to mark it as resolved 
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
yes, i have marked resolved