Why my code fails testcases

#include <bits/stdc++.h>
using namespace std;

int main()
{
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int m;
cin>>m;
int cn=0;
int mini=INT_MAX;
int f=0,s=0;
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if(a[i]+a[j]==m)
{

         if(mini>abs(a[j]-a[i]))
         {
             mini=abs(a[j]-a[i]);
             f=i;
             s=j;
         }
       }
   }

}
cout<<"Deepak should buy roses whose prices are β€œ<<a[s]<<” and "<<a[f]<<endl;
}
}

#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while(t–) { int n; cin >> n; int a[n]; for (int i=0;i<n;i++) { cin >> a[i]; } int m; cin >> m; sort(a,a+n); int x=0; int y=n-1; int f=0; int s=0; while(x<y) { if(a[x]+a[y]==m) { f=a[x]; s=a[y]; x++; y–; } else if(a[x]+a[y]>m) { y–; } else if(a[x]+a[y]<m) { x++; } } cout<<β€œDeepak should buy roses whose prices are β€œ<<f<<” and β€œ<<s<<” .”<<endl; } }

hi @tarunkumar08yadav dont print space before fullstop

my logic is write or

my logic is write or wrong it gives wrong output on testcase 1 after not print space before fullstop

hi @tarunkumar08yadav check again and send me ss, for me itis running on all test cases