#include <bits/stdc++.h>
using namespace std;
using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;
const double eps = 1e-10;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int64 n, q;
  cin >> n >> q;
  for (int _ = 0; _ < (q); _++) {
    int64 x;
    cin >> x;
    x--;
    if (x % 2 == 0)
      cout << (x / 2 + 1) << endl;
    else {
      int64 l = 0, r = n;
      while (x % 2) {
        x = x + (n - (x + 1) / 2);
      }
      cout << (x / 2 + 1) << endl;
    }
  }
}
