Code is running but not submitting

#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int tar;
int *arr =new int[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
cin>>tar;
sort(arr,arr+n);
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
for(int k=j+1;k<n;k++)
{
if(arr[i]+arr[j]+arr[k]==tar)
{
cout<<arr[i]<<", “<<arr[j]<<” and "<<arr[k]<<endl;
}
}

	}
	
} 
return 0;

}