QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#605. Alternating permutation

Statistics

In combinatorial mathematics, an alternating permutation (or zigzag permutation) of the set $\{1, 2, 3, \cdots, n\}$ is a permutation (arrangement) of those numbers so that each entry is alternately greater or less than the preceding entry.

Calculate the number of the alternating permutations $p_1,p_2,\cdots,p_n$ such that $p_1 = a$ and $p_n = b$.

Input

The first line of the input contains three integers $n$, $a$ and $b$.

It is guaranteed that $2 \le n \le 2\,000$ and $1 \le a, b \le n$ and $a \ne b$.

Output

Output a single line contains a single integer, indicating the answer.

Example

Input

2000 249 662

Output

979748465

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.