#include using namespace std; int main(){ int64_t N,M,T,a=0,i=1;cin>>N>>M; vectorF(5e6,1),R(N,0); for(F[0]=0;F[i]||F[i+1]>1;T=++i)F[i+2]=(F[i+1]+F[i])%N; for(;i;i--)R[(F[i+2]-1+N)%N]+=((M-2)/T)+(i<=(M-2)%T?1:0); for(R[0]++;i