#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
const int mod = 1000000007;
long long int solve(long long int pos) {
  if (pos % 2 == 1) {
    return (pos + 1) / 2;
  }
  solve(pos / 2);
}
int main() {
  long long int n, x, q, i, j, k;
  scanf("%lld %lld", &n, &q);
  while (q--) {
    scanf("%lld", &x);
    long long int ans;
    if (x % 2 == 1) {
      ans = (x + 1) / 2ll;
    } else {
      long long int d = ((2 * n - 1) - x) / 2;
      ans = solve(d + 1);
      ans = n - ans + 1;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
