fork download
  1. #include <cmath>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <iostream>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8. void cal(int n){
  9. long long int c=1;
  10. for(int i=1;i<=n+1;i++){
  11. cout<<c%1000000000<<" ";
  12. c=c*(n+1-i)/i;
  13. }
  14. }
  15.  
  16. int main() {
  17. int t;
  18. cin>>t;
  19. while(t--){
  20. int n;
  21. cin>>n;
  22. cal(n);
  23. cout<<endl;
  24.  
  25. }
  26. /* Enter your code here. Read input from STDIN. Print output to STDOUT */
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 16064KB
stdin
3
6
76
88
stdout
1 6 15 20 15 6 1 
1 76 2850 70300 1282975 18474840 218618940 186189400 855883575 466675900 526728530 160371180 118677225 276564800 244541600 544105280 261901380 100828400 441604200 663844400 556478959 -311749043 -792574806 83065743 -179461134 815102905 -543819363 278466054 -609454106 877784638 -848455787 54212432 607486232 -181216891 -376244891 225921891 -234632057 -550953575 769009531 236470825 718735513 948158011 623465009 841809542 881357156 382298422 322853284 142246777 648440761 799109006 411518863 699990008 855764426 330912192 529832970 11933188 379474945 817359629 216031602 608280827 739012900 292200104 780370992 284526887 73419523 198169758 33028293 4929595 652446 75645 7564 639 44 2 0 0 0 
1 88 3828 109736 2331890 39175752 541931236 348337336 276915527 350360240 667845896 8361808 886988268 647008336 680401800 956648880 114710515 -144140855 232505695 -970218577 -111776509 -409562029 -929120724 -200539833 653102602 271942661 247032154 493184946 -843759639 485654250 -201865028 129076773 917418001 -313155865 -506575663 181556166 -669085411 835597574 68828323 -212003473 33034535 -832290096 490283740 175652373 -927390791 -906782106 -891122403 -51641296 -23276940 -488389338 -920943683 -627369803 -542551590 -123242589 -653953529 -476989454 -209654499 -556297262 -866296812 -50659395 -907818707 -547851209 -45031978 -494775102 -537021524 -859823331 -829938433 -18785754 -49919129 -449251921 -121939807 -847815725 -144623157 -250876308 -50853305 -9492616 -1623736 -253049 -35686 -4517 -508 -50 -4 0 0 0 0 0 0