buycomputer

Problem Description

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.

Input

The first line of input will contain two integers, N and Q.

The next line of input will contain space-seperated integers, P1, P2 ... PN.

The following line of input will contain Q space-seperated integers, M1, M2 ... MQ.

Output

The output should contain a single line of Q space-seperated integers, answering each query.

Limits

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.

Sample Input

5 7
9 4 6 3 2
3 1 4 1 5 9 2

Sample Output

4 -1 2 -1 2 1 5


Submitting .cpp to 'buycomputer'


You're not logged in! Click here to login

Time Limit: 1 Seconds
Memory Limit: 256MB
Your best score: 0
Source: Dec Trg 2019 (Elementary) (errorgorn)

Subtask Score
1 0
2 25
3 75