fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main(){
  6. ios::sync_with_stdio(0);
  7. cin.tie(0);
  8. int t;
  9. cin>>t;
  10. while(t--){
  11. long long n;
  12. cin>>n;
  13. if (n>=1000000007) cout<<0<<"\n";
  14. else {
  15. long long answer=1;
  16. for(int i=2;i<=n;i++){
  17. answer=(answer*i)%1000000007;
  18.  
  19.  
  20.  
  21. }
  22. cout<<answer<<"\n";
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
Standard output is empty