#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e17 + 1;
const int N = (int)2e5 + 77;
const long long mod = (long long)1e9 + 7;
long long n, m, k, q, x, y;
long long track(long long p) {
  if (p & 1) return (p + 1) / 2;
  p = (p - 2) / 2 + 1;
  p = n - p;
  return track(2 * n - 1 - p + 1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= (int)(q); ++i) {
    cin >> x;
    cout << track(x) << endl;
  }
  return 0;
}
