Count vectors of w heights in [0,h] whose sum is at most n and which are not all equal, modulo 1e9+7.
Medium6Dynamic programmingCombinatoricsMathPrefix sumNo attempts yetTime limit5sMemory limit512 MBAn artist has a roll of ribbon one inch wide. She cuts the ribbon into pieces of integer length, then stands the pieces vertically in columns along the bottom edge of a frame to form a mountain scene. A mountain scene must be uneven. If every column has the same height, the picture is a plain, not a mountain. She does not have to use all of the ribbon.

The frame is w inches wide and h inches tall, so there are w columns from left to right and each column has an integer height between 0 and h. A column of height 0 holds no ribbon. There is no point in putting more than one piece of ribbon in a column, so each column holds at most one piece. The lengths of the pieces she uses add up to at most n.
With 4 inches of ribbon and a 2 × 2 inch frame she can form these scenes.

She does not form these scenes, because they are plains rather than mountains.

You are given the length of the ribbon n and the width w and height h of the frame, all in inches. Count the different mountain scenes she can create. Two scenes are different when the regions covered by ribbon differ.
One line with three space-separated integers n, w and h. Here n (0 ≤ n ≤ 10,000) is the length of the ribbon, w (1 ≤ w ≤ 100) is the width of the frame and h (1 ≤ h ≤ 100) is the height of the frame, all in inches.
Print a single integer, the total number of mountain scenes the artist could make, modulo 109+7.