#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MAX_N = 2e5 + 10;
const long long MOD = 1e9 + 7;
long long x, n, q;
long long FIND(long long left, long long right) {
  if (right % 2 == 1) {
    return right / 2 + 1;
  }
  FIND(right + 1, n + right / 2);
}
int main() {
  scanf("%lld %lld", &n, &q);
  for (int i = 1; i <= q; i++) {
    scanf("%lld", &x);
    if (x % 2 == 1)
      printf("%lld\n", x / 2 + 1);
    else
      printf("%lld\n", FIND(x + 1, n + x / 2));
  }
}
