문제2692--Pole Arrangement

2692: Pole Arrangement

실행시간 제한: 1 Sec  메모리사용 제한: 128 MB
제출: 3  통과: 3
[제출] [채점기록] [묻고답하기]

문제 설명

There are n poles of height 1, 2, ... , n in a row. If you look at these poles from the left side or the right side, smaller poles are hidden by taller poles. For example, consider the two arrangements of 4 poles in the next figure:

For each arrangement, only one pole can be seen from the left, and two poles can be seen from the right.

You are to write a program to calculate the number of arrangements of n poles such that seen from the left you see l poles and seen from the right you see r poles.

입력 설명

Your program is to read from standard input. The input consists of T test cases. The number of test cases T is given in the first line of the input. Each test case consists of a line containing three integers, n, l, and r (1 ≤ l,r ≤ n ≤ 20), where n is the number of poles and (resp. r) is the number of poles that can be seen from the left(resp. right).

출력 설명

Your program is to write to standard output. Print exactly one line for each test case. The line should contain the number of arrangements of poles for the test case.

입력 예시 Copy

4
4 1 2
4 1 1
5 2 4
20 2 1

출력 예시 Copy

2
0
4
6402373705728000

출처/분류