Still it is failing to run all the test cases

#include
#include
using namespace std;

int main() {
int N;
cin>>N;
int target;
cin>>target;
int a[N];
for(int i=0;i<N;i++)
{
cin>>a[i];
}
sort(a,a+N);

for(int i=0;i<N;i++)
{
    for(int j=i+1;j<N;j++)
    {
        if(a[i]+a[j]==target)
        {
            cout<<a[i]<<" and "<<a[j]<<endl;  
        }
    }
}
return 0;

}

hello @deepteaman

pls go to this link -> https://ide.codingblocks.com/

paste ur code in the editor ,press ctrl + s and then save
a url will be generated in ur search bar ,copy that link and paste it here in the forum

check now->

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.