#include <bits/stdc++.h>
using namespace std;
long long solve(long long x, long long n) {
  long long mx = n + 1, mn = 2;
  while (x % 2 != 1) {
    long long cnt = (mx - mn) / 2;
    if ((mx % 2) && (mn % 2 == 0)) cnt++;
    long long rk = (x - mn) / 2 + 1;
    x = mx + rk - 1;
    mn = mx;
    mx += cnt;
  }
  return (x + 1) / 2;
}
int main() {
  long long n, q;
  while (~scanf("%lld %lld", &n, &q)) {
    for (int i = 0; i < q; i++) {
      long long x;
      scanf("%lld", &x);
      printf("%lld\n", solve(x, n));
    }
  }
  return 0;
}
