1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <math.h> 5 #include <iostream> 6 #include <algorithm> 7 #include <climits> 8 #include <queue> 9 #define ll long long 10 11 using namespace std; 12 13 14 const int MAX = 200005; 15 const ll MOD = 1e9+7; 16 ll F[1010],C[1010][1010]; 17 18 void init() 19 { 20 F[0] = 1; 21 F[1] = 0; 22 F[2] = 1; 23 for(int i = 3; i <= 1000; i++) 24 F[i] = (i-1)*(F[i-1]+F[i-2])%MOD; 25 26 for(int i = 0; i <= 1000; i++) 27 { 28 for(int j = 0; j <= i; j++) 29 { 30 if(j == 0) 31 C[i][j] = 1; 32 else 33 C[i][j] = (C[i-1][j]+C[i-1][j-1])%MOD; 34 } 35 } 36 } 37 38 void solve() 39 { 40 int n,m,k; 41 scanf("%d %d %d",&n,&m,&k); 42 ll ans = 0; 43 for(int i = 0; i <= n-m; i++) 44 { 45 ans += (C[n-m][i]*F[n-k-i]); 46 ans %= MOD; 47 } 48 ans *= C[m][k]; 49 ans %= MOD; 50 printf("%lld ",ans); 51 } 52 53 int main(void) 54 { 55 init(); 56 int t,cnt = 0; 57 scanf("%d",&t); 58 while(t--) 59 { 60 printf("Case %d: ",++cnt); 61 solve(); 62 } 63 return 0; 64 }