#P16158. [ICPC 2016 NAIPC] Mountain Scenes

[ICPC 2016 NAIPC] Mountain Scenes

题目描述

An artist begins with a roll of ribbon, one inch wide. She clips it into pieces of various integral lengths, then aligns them with the bottom of a frame, rising vertically in columns, to form a mountain scene. A mountain scene must be uneven; if all columns are the same height, it’s a plain scene, not a mountain scene! It is possible that she may not use all of the ribbon.

:::align{center} :::

If our artist has 44 inches of ribbon and a 2×22 \times 2 inch frame, she could form these scenes:

:::align{center} :::

She would not form these scenes, because they’re plains, not mountains!

:::align{center} :::

Given the length of the ribbon and the width and height of the frame, all in inches, how many different mountain scenes can she create? Two scenes are different if the regions covered by ribbon are different. There’s no point in putting more than one piece of ribbon in any column.

输入格式

Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. The input will consist of a single line with three space-separated integers nn, ww and hh, where nn (0n10,0000 \leq n \leq 10,000) is the length of the ribbon in inches, ww (1w1001 \leq w \leq 100) is the width and hh (1h1001 \leq h \leq 100) is the height of the frame, both in inches.

输出格式

Output a single integer, indicating the total number of mountain scenes our artist could possibly make, modulo 109+710^9 + 7.

25 5 5
7770
15 5 5
6050
10 10 1
1022
4 2 2
6