
8 15
1 2 8 7 2 4 11 15
4 11
7 14
1 8 7 2 4 11 15
No Solution
#include
int main(){
int n, m, d, hash[501] = {0};
scanf("%d%d", &n, &m);
for(int i = 0; i < n; i++){
scanf("%d", &d);
hash[d]++;
}
for(int i = 1; i < 501; i++){
if(hash[i] && m > i && m - i <= 500){
hash[i]--;
if(hash[m-i]) {
printf("%d %d", i, m - i);
return 0;
}
}
}
printf("No Solution");
return 0;
}