Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include<bits/stdc++.h>
using namespace std;
int main(){
const unsigned int M = 1000000007;
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--){
long long n;
cin>>n;
unsigned long long fact = 1;
for(int i = 1; i <= n*2; i++){
fact = (fact * i)%M;
fact = fact%M;
}
cout<<(fact*500000004)%M<<endl;
}
}
Copy The Code &
Try With Live Editor
Input
4
1
2
9
91234
1
2
9
91234
Output
1
12
830455698
890287984
12
830455698
890287984
Demonstration
Codeforcess Solution 1581-A A. CQXYM Count Permutations ,C++, Java, Js and Python ,1581-A,Codeforcess Solution