#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, q;
  cin >> n >> q;
  for (long long t = 1; t <= q; t++) {
    long long x;
    cin >> x;
    if (x % 2 == 1) {
      cout << (x + 1) / 2 << endl;
    } else {
      long long xx = n - (x / 2), gran = n + (x / 2);
      while (gran % 2 == 0) {
        xx /= 2;
        gran += xx;
      }
      cout << (gran + 1) / 2 << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}
