#include <bits/stdc++.h>
const int MAXN = 200005;
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long n, q, k;
  cin >> n >> q;
  while (q--) {
    cin >> k;
    while (k % 2 == 0) {
      k += (n - k / 2);
    }
    cout << k / 2 + 1 << endl;
  }
  return 0;
}
