QOJ.ac

QOJ

时间限制: 1 s 内存限制: 256 MB 总分: 100

#15772. Queueing

统计

There are $n$ male students, $m$ female students, and two teachers in a middle school who need to line up for a physical examination. They form a single line such that no two female students are adjacent, and the two teachers are also not adjacent. How many possible arrangements are there? (Note: Every individual is distinct.)

Input

The input consists of a single line containing two non-negative integers $n$ and $m$, separated by a space, with the meanings as described above.

Constraints

  • For 30% of the data: $n \le 100, m \le 100$
  • For 100% of the data: $n \le 2000, m \le 2000$

Output

The output should contain a single non-negative integer representing the number of different arrangements. Note that the answer may be very large.

Examples

Input 1

1 1

Output 1

12

Input 2

7 3

Output 2

220631040

Discussions

About Discussions

The discussion section is only for posting: 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.
  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.