#include #include using namespace std; namespace mp = boost::multiprecision; int main(){ long long K,Q; cin>>K>>Q; vector N(Q); long long mN=0; for(int i=0;i>N[i]; mN=max(mN,N[i]); } vector X(1); X[0]=1; while(X[X.size()-1]<=mN){ long long last=X[X.size()-1]; X.push_back(last+(last+K-2)/(K-1)); } X.pop_back(); for(int i=0;i1){ int mid=(m+M)/2; if(X[mid]<=N[i]){ m=mid; }else{ M=mid; } } cout<