fork download
  1. #include <stdio.h>
  2.  
  3. int calc_fact(int n)
  4. {
  5. if(n==1)
  6. return 1;
  7. else
  8. return n*calc_fact(n-1);
  9. }
  10.  
  11. int main()
  12. {
  13. int n, i, count, k, tcs, j, l, m;
  14. scanf("%d", &tcs);
  15. int fact[tcs];
  16. int arr[tcs];
  17. for(j=0; j<tcs; j++)
  18. {
  19. scanf("%d", &arr[j]);
  20. }
  21.  
  22. j=0;
  23. m=0;
  24. while(m<tcs && j<tcs)
  25. {
  26. fact[m]=calc_fact(arr[j]);
  27. m++;
  28. j++;
  29. }
  30.  
  31.  
  32. m=0;
  33. for(l=0; l<tcs; l++)
  34. {
  35. i=1;
  36. count=0;
  37. while(i<=fact[m])
  38. {
  39. if((fact[m])%i==0)
  40. count++;
  41. i++;
  42. }
  43. m++;
  44. k=(count)%((10^9)+7);
  45. printf("%d\n", k);
  46.  
  47. }
  48.  
  49. return 0;
  50. }
  51.  
Success #stdin #stdout 0s 3464KB
stdin
3
2
3
4
stdout
2
4
8