#include
#include <bits/stdc++.h>
using namespace std;
int main() {
int t ;
cin >> t ;
while(t–){
int n ; cin >> n ;
int price[n];
for(int i = 0 ; i < n ; i++){
cin >> price[i] ;
}
int m ;
cin >> m ;
sort(price,price + n);
int i = 0 ;
int j = n-1 ;
int min = INT_MAX;
int first = 0 ;
int second = 0 ;
while(i < j ){
if(price[i] + price[j] == m){
if(abs(price[i] - price[j]) < min){
min = abs(price[i] - price[j]);
first = price[i] ;
second = price[j];
}
i++ ;
j-- ;
}
else if(price[i] + price[j] > m ){
j--;
}
else if(price[i] + price[j] < m ){
i++ ;
}
}
cout << "Deepak should buy roses whose prices are "<<first << " and " << second << endl ;
}
cout << endl ;
}
please tell me my mistake