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