Problems
Table
Table
Let n be a positive integer. Integers 1, 2, 3, ..., 2n are divided into three sets A, B and C. Write a program, which calculates the number of ways to fill the table with two rows and n columns so that:
- Each cell of the table contains a single integer;
- The integers of the set A should be written on the first row of the table;
- The integers of the set B should be written on the second row of the table;
- The integers of the set C can be written on any table row;
- The numbers in each row of the table should form an increasing sequence;
- The numbers in each column of the table should form an increasing sequence.
For example, if n = 4 , A = {2, 3} , B = {4, 7, 8} and C = {1, 5, 6} , then there are exactly two tables of required type.
Input
On the first row is given the integer n (1 < n ≤ 35). On the second row are given m - the number of integers of the set A, and integers of the set A (0 ≤ m ≤ n). On the third row are given k - the number of integers of the set B, and integers of the set B (0 ≤ k ≤ n).
Output
The program should print a single line holding the result.
Input example #1
4 2 3 2 3 4 8 7
Output example #1
2