#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 200005;
vector<pair<ll, int>> q;
ll result[N];
ll n;
int m;
void solve(ll n, vector<pair<ll, int>> q, ll add) {
  if (n <= 2) {
    for (auto& item : q) {
      result[item.second] = add + item.first;
    }
    return;
  }
  vector<pair<ll, int>> now;
  ll total = n / 2;
  for (auto& item : q) {
    if (item.first % 2 == 0) {
      result[item.second] = add + item.first / 2;
    } else {
      int cur = n % 2 == 0;
      ll pos = item.first == n - 1 && n % 2 == 0 ? 1 : item.first / 2 + 1 + cur;
      now.emplace_back(pos, item.second);
    }
  }
  solve(n / 2 + 1, now, add + (n - 1) / 2);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < (m); ++i) {
    ll x;
    cin >> x;
    --x;
    q.emplace_back(x, i);
  }
  solve(n, q, 0);
  for (int i = 0; i < (m); ++i) {
    cout << result[i] + 1 << '\n';
  }
  return 0;
}
