fork download
  1. #include "bits/stdc++.h"
  2. using namespace std;
  3. const int N=2e3+20,MOD=1e9+7;
  4. int c[N][N],n,k,red,blue,ans;
  5. int main()
  6. {
  7. c[0][0]=1;
  8. for(int n=1;n<N;n++)
  9. {
  10. for(int r=0;r<=n;r++)
  11. {
  12. if(r==0 or r==n) c[n][r]=1;
  13. else c[n][r]=c[n-1][r-1]+c[n-1][r];
  14. c[n][r]%=MOD;
  15. }
  16. }
  17.  
  18. cin>>n>>k;
  19.  
  20. blue=k,red=n-k;
  21. for(int k=1;k<=blue;k++)
  22. {
  23. ans=(1ll*c[red+1][k]*c[blue-1][k-1])%MOD;
  24. printf("%d\n",ans);
  25. }
  26. }
Success #stdin #stdout 0s 31168KB
stdin
5 3
stdout
3
6
1