#include <bits/stdc++.h>
using num = uint64_t;
uint64_t n;
uint64_t track(uint64_t x) {
  uint64_t pos = x;
  uint64_t l, r;
  while (pos % 2 != 0) {
    l = (pos + 1) / 2;
    r = n - l - 1;
    pos += r + 1;
  }
  return pos / 2 + 1;
}
int main() {
  std::cin >> n;
  uint64_t q;
  std::cin >> q;
  for (uint64_t i = 0; i < q; i++) {
    uint64_t x;
    std::cin >> x;
    x--;
    std::cout << track(x) << std::endl;
  }
}
