#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, q;
  cin >> n >> q;
  for (int i = 0; i < q; i++) {
    long long y;
    cin >> y;
    if (y % 2 == 1)
      cout << (y / 2 + 1) << endl;
    else {
      long long i = 0;
      long long x = n - y / 2;
      for (i = y; i % 2 == 0; i += x, x = n - i / 2)
        ;
      cout << (i / 2 + 1) << endl;
    }
  }
}
