#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 1;
long long int n, q, m;
long long int getAns(long long int x) {
  if (x >= n && x % 2 == 1) {
    return x / 2 + 1;
  } else {
    long long int num = n - x / 2;
    return getAns(x + num);
  }
}
int main() {
  scanf("%I64d %I64d", &n, &q);
  for (int i = 1; i <= q; ++i) {
    scanf("%I64d", &m);
    long long int ans;
    if (m % 2 == 1 && m <= n) {
      ans = m / 2 + 1;
    } else {
      ans = getAns(m);
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
