#P3223. [HNOI2012] 排队

    ID: 2272 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>数学高精度2012各省省选湖南组合数学

[HNOI2012] 排队

Description

A certain middle school has nn boys, mm girls, and two teachers who are to line up for a physical examination. They form a single straight line, and no two girls may stand adjacent, and the two teachers may not be adjacent either. How many different lineups are there? (Note: every individual is distinct.)

Input Format

A single line containing two non-negative integers nn and mm, separated by a space, as described above.

Output Format

A single non-negative integer, denoting the number of different lineups. Note that the answer may be large.

1  1
12

Hint

For 30%30\% of the testdata, n100n \leq 100, m100m \leq 100.

For 100%100\% of the testdata, n2000n \leq 2000, m2000m \leq 2000.

Translated by ChatGPT 5