PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000102. Vị trí gần nhất bên phải (Closest to the Right)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Vị trí gần nhất bên phải (Closest to the Right)

Closest to the Right

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given a non-decreasing array a1,…,ana_1,\ldots,a_n, report the smallest one-based index pp with ap≥xa_p\ge x. If none exists, output n+1n+1.

Input

The first line contains n,qn,q, followed by a line of nn sorted integers and a line of qq queries.

Output

Print the qq positions in query order, separated by spaces.

Subtasks

  • Subtask 1 (20 points): 1≤n,q≤201\le n,q\le 20; −109≤ai≤109-10^9\le a_i\le10^9; −109≤xj≤109-10^9\le x_j\le10^9; array is non-decreasing.
  • Subtask 2 (30 points): 1≤n,q≤20001\le n,q\le 2000; −109≤ai≤109-10^9\le a_i\le10^9; −109≤xj≤109-10^9\le x_j\le10^9; array is non-decreasing.
  • Subtask 3 (50 points): 1≤n,q≤1000001\le n,q\le 100000; −109≤ai≤109-10^9\le a_i\le10^9; −109≤xj≤109-10^9\le x_j\le10^9; array is non-decreasing.

Examples

Input

5 5
1 3 3 4 10
3 2 11 0 4

Output

2 2 6 1 4

Explanation

For targets 33 and 22, the first qualifying position is 22; 1111 exceeds every element so output 66; 00 qualifies at position 11; 44 first qualifies at position 44.