线性递推逆元模板
#include<iostream>
#include<cstdio>
#include<cstring>
#define re register
using namespace std;
int n,p,inv[];
int main(){
scanf("%d%d",&n,&p); inv[]=; puts("");
for(re int i=;i<=n;++i){
inv[i]=1ll*(p-p/i)*inv[p%i]%p;
printf("%d\n",inv[i]);
}return ;
}