Hearing that a faster computer will allow you to compile code faster, Takahashi decides to buy a new computer to increase his AtCoder ranking.
Takahashi has a list of N computers that he is considering to buy. The i-th computer has a price Pi yen (the currency of Japan) and is arranged such that the computers are sorted in decreasing order of how much Takahashi prefers it.
Takahashi has Q queries. In the i-th query, he wants to know what the best computer he can buy with Mi yen is. So print out the index of that computer. If he cannot buy any of the computers, print -1.
The first line of input will contain two integers, N and Q.
The next line of input will contain N space-seperated integers, P1, P2 ... PN.
The following line of input will contain Q space-seperated integers, M1, M2 ... MQ.
The output should contain a single line of Q space-seperated integers, answering each query.
For all subtasks: 1 ≤ N,Q ≤ 100000, 1 ≤ Pi,Mi ≤ 1018
Subtask 1 (25%): N,Q ≤ 1000.
Subtask 2 (75%): No additional constraints.
Subtask 3 (0%): Sample test cases.
5 7
9 4 6 3 2
3 1 4 1 5 9 2
4 -1 2 -1 2 1 5
Subtask | Score |
---|---|
1 | 0 |
2 | 25 |
3 | 75 |