#include <bits/stdc++.h>
int const MOD = 1000000000 + 7;
int const MAX_N = 100000 + 5;
long long calc(long long n, long long x) {
  while (!(x & 1)) x = n + (x >> 1);
  return (1 + x) >> 1;
}
int solve() {
  long long n;
  int q;
  scanf("%lld %d", &n, &q);
  for (int i = 0; i < q; ++i) {
    long long x;
    scanf("%lld", &x);
    printf("%lld\n", calc(n, x));
  }
  return 0;
}
int main(int argc, char* argv[]) {
  solve();
  return 0;
}
