#include <bits/stdc++.h>
using namespace std;
long long n;
int q;
long long work(long long x, long long base) {
  if (x & 1) return x / 2LL + 1LL + base;
  return work(x - x / 2, base + x / 2);
}
int main() {
  cin >> n >> q;
  while (q--) {
    long long x;
    cin >> x;
    if (x & 1)
      cout << x / 2LL + 1LL << endl;
    else
      cout << work(n - x / 2LL, x / 2LL) << endl;
  }
  return 0;
}
