Unammed - MarisaOJ: Marisa Online Judge

Unammed

Time limit: 1000 ms
Memory limit: 256 MB
Given two arrays $A$ and $B$, both consisting of $n$ integers, and an integer $x$. Count the number of pairs $i, j$ such that $A_i + B_j = x$. ### Input - The first line consists of two integers $n, x$. - The second line contains $n$ integers $A_i$. - The third line contains $n$ integers $B_i$. ### Output - Output an integer as the answer. ### Constraints - $1 \le n \le 10^5$. - $0 \le |A_i|,|B_i| \le 10^9$. ### Sample test Input ``` 5 6 1 2 3 9 10 -3 5 3 2 1 ``` Output: ``` 3 ```