#include using namespace std; int main() { int n, x; int *array; cin >> n >> x; array = new int[n]; for (int i = 0;i < n;i++) { cin >> array[i]; } int count = 0; for (int i = 0;i < n;i++) { for (int j = 0;j < n;j++) { if (array[i] + array[j] == x)count++; } } cout << count; delete[] array; return 0; }