Problem J
Siggi sement
Languages
en
is
Siggi works for the city, filling in potholes most days. One day he sees an unusually large hole in the road in the outskirts of Reykjavík. The residents there are quite impatient and want this fixed immediately.
Siggi measures the hole and sees it is exactly $K$ units in size. He decides to fix it himself, and thus goes to the nearest store to buy cement. There he can buy bags of cement of all kinds of sizes and shapes. His back is quite shot so he wants to buy exactly two bags so he can spread the weight somewhat evenly. He also doesn’t want to carry more than necessary so he wants the bags to be exactly $K$ units put together.
You are given a list of all bags that are available and their sizes. There could be many bags of the same size. Can you help Siggi pick two bags that have a total size of exactly $K$?
Input
The first line contains two integers $N$, the number of bags at the store, and $K$, the size of the hole. Then there are $N$ lines, one for each bag of cement, each containing an integer $S_i$, the size of the cement bag.
Output
Print the sizes of two bags from the store that satisfy constraints. Each bag can only be chosen once (but two different bags of the same size can both be chosen).
If there are several solutions, any one of them can be printed. If there are no solutions instead print Neibb.
Explanation of Sample Inputs
In the first sample Siggi can choose bags of sizes $3$ and $17$. In total they have size $3+17=20$, as is asked. Another possible solution would be choosing bags of sizes $4$ and $16$.
In the second sample there is only one bag, so he can’t chosoe 2 bags.
In the third sample Siggi can choose bags of sizes $5$ and $5$.
Scoring
The solution will be tested on input data of varying difficulty and the data is divided into groups as shown in the table below. The solution will then be scored according to how many groups are solved.
Group |
Points |
Constraints |
1 |
30 |
$ 1 \le N \le 10^3$, $ 1 \le K \le 10^9$ |
2 |
10 |
$ 1 \le N \le 10^3$, $ 1 \le K \le 10^{18}$ |
3 |
30 |
$ 1 \le N \le 2\cdot 10^5$, $ 1 \le K \le 100$ |
4 |
30 |
$ 1 \le N \le 2\cdot 10^5$, $ 1 \le K \le 10^{9}$ |
Sample Input 1 | Sample Output 1 |
---|---|
5 20 4 17 9 3 16 |
4 16 |
Sample Input 2 | Sample Output 2 |
---|---|
1 10 5 |
Neibb |
Sample Input 3 | Sample Output 3 |
---|---|
2 10 5 5 |
5 5 |