#include <bits/stdc++.h>
using namespace std;
long long ric(long long pos, long long n) {
  if (pos % 2 == 0) return pos / 2;
  long long mid = n - (n % 2);
  if (pos < mid)
    return (n / 2) + ric(pos / 2 + (n % 2), (n + 1) / 2);
  else
    return (n / 2) + ric(pos - mid, (n + 1) / 2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, q;
  cin >> n >> q;
  while (q--) {
    long long v;
    cin >> v;
    cout << ric(v - 1, n) + 1 << "\n";
  }
}
