#include <bits/stdc++.h>
using namespace std;
long long n, q, sum, x;
int main(void) {
  scanf("%lld%lld", &n, &q);
  while (q--) {
    scanf("%lld", &x);
    while (x % 2 == 0) {
      sum = (x + 1) / 2 + 1, sum = n - sum, x += sum + 1;
    }
    printf("%lld\n", x / 2 + 1);
  }
  return 0;
}
