#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long solve(long long n, long long pos, long long carry) {
  if (n == 1) return 1;
  if (pos % 2 == carry) {
    return (pos + carry) / 2;
  }
  if (carry == 1) {
    return 1 + solve(n - 1, pos - 1, 0);
  } else {
    return n / 2 + solve((n + 1) / 2, (pos + 1) / 2, n % 2);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  int q;
  cin >> q;
  while (q--) {
    long long x;
    cin >> x;
    cout << solve(n, x, 1) << "\n";
  }
}
