#include <iostream>
using namespace std;
long long a[13]={},b[13]={};
long long rec(int i){
if(a[i])
return a[i];
return a[i]=(i-1)*(rec(i-1)+rec(i-2));
}
long long fac(int i){
if(i<2)
return 1LL;
return fac(i-1)*i;
}
int main(){
a[2]=1,a[3]=2,a[4]=9;
int t;
cin>>t;
while(t--){
int n;
cin>>n;
cout<<rec(n)<<'/'<<fac(n)<<endl;
}
}
using namespace std;
long long a[13]={},b[13]={};
long long rec(int i){
if(a[i])
return a[i];
return a[i]=(i-1)*(rec(i-1)+rec(i-2));
}
long long fac(int i){
if(i<2)
return 1LL;
return fac(i-1)*i;
}
int main(){
a[2]=1,a[3]=2,a[4]=9;
int t;
cin>>t;
while(t--){
int n;
cin>>n;
cout<<rec(n)<<'/'<<fac(n)<<endl;
}
}
Comments
Post a Comment