Team Building
Every year, Farmer John brings his n cows to compete for "best in show" at the state fair. His arch-rival, Farmer Paul, brings his m cows to compete as well.
Each of the n + m cows at the event receive an individual integer score. However, the final competition this year will be determined based on teams of k cows, as follows: Farmer John and Farmer Paul both select teams of k of their respective cows to compete. The cows on these two teams are then paired off: the highest-scoring cow on FJ's team is paired with the highest-scoring cow on FP's team, the second-highest-scoring cow on FJ's team is paired with the second-highest-scoring cow on FP's team, and so on. FJ wins if in each of these pairs, his cow has the higher score.
Please help FJ count the number of different ways he and FP can choose their teams such that FJ will win the contest. That is, each distinct pair (set of k cows for FJ, set of k cows for FP) where FJ wins should be counted. Print your answer modulo 10^9
+ 9.
Input
The first line contains n, m (1 ≤ n ≤ 1000, 1 ≤ m ≤ 1000) and k (1 ≤ k ≤ 10). The value of k will be no larger than n or m. The next line contains the n scores of FJ's cows.
The final line contains the m scores of FP's cows.
Output
Print the number of ways FJ and FP can pick teams such that FJ wins, modulo 10^9
+ 9.