#include #include #include using namespace std; using ll=long long; const ll MAX=1e18; int main() { int k, q; cin>>k>>q; vector v{1}; while(v.back()<=MAX){ v.push_back(v.back()+(v.back()+k-2)/(k-1)); } while(q--){ ll n; cin>>n; cout<