#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const long long mod = 1e9 + 7;
long long n, q;
long long fast_exp(long long base, long long expo) {
  long long res = 1;
  while (expo > 0) {
    if (expo & 1) {
      res = (res * base) % mod;
    }
    base = (base * base) % mod;
    expo >>= 1;
  }
  return res;
}
long long recurse(long long x) {
  if (x & 1) {
    return (x + 1) / 2;
  }
  long long y = n + x / 2;
  return recurse(y);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> q;
  for (long long i = 0; i < q; i++) {
    long long x;
    cin >> x;
    cout << recurse(x) << '\n';
  }
  return 0;
}
