#include<stdio.h>
#include<stdlib.h> //·¥´ý
#include<string>
#include<math.h>
#include<algorithm>
#define INT long long int
using namespace std;
char in[100], out[100];

int n, k, t;
int f(int c, int a1, int a2, int a3, int d){
	if(c>n or a1 >=k or a2 >= k or a3 >= k or d>t) return 0;
	if(c==n) return 1;
	return f(c+1, a1+1,a2, a3, d+1)+f(c+2, a1,a2+1, a3, d+1)+f(c+3, a1,a2, a3+1, d+1);
}

int main(){
	int PP = 0;
	for(int I = 1; I<=20; I++){
		sprintf(in,".%d.in",++PP);
	        freopen(in,"w",stdout);
	        n = 30-I/2;
        	k = 10-(rand()%2);
	        t = 20-(rand()%2);
			//scanf("%d", &n);
			printf("%d %d %d", n, k, t);
			sprintf(in,".%d.out",PP);
	        freopen(in,"w",stdout);
			printf("%d",f(0,0,0,0,1));
	
	}
}
