Human Pyramid
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

  1. The Barefooted Acrobatics People’s Club wants to make a group photo in an original way. For the photo, they want to make a human pyramid, where each person rests on the ground or rests on the shoulders of two people below him or her.

Making a human pyramid demands a lot from the acrobats involved, so the club selected a group consisting of strong people of which they are assured that these people can carry enough weight. The others are ‘agile’ and to make sure everyone is comfortable during the photo, there can only be agile people directly above an agile person.

The photographer wants to make a photo of a pyramid with h people on the flfloor, h−1 on the second layer, h−2 on the third layer, and so on, with a single person on the hth layer. You have s strong people at your disposal, and the other  h(h + 1) − s people are agile. What is the number of ways you can arrange the pyramid satisfying the demands of the photographer? Since this number may be large, you should fifind it modulo 109 + 7.

Two pyramids P1 and P2 are difffferent if there exists a location where P1 has an agile person and P2 a strong person, or vice versa.

输入描述:

The input consists of:
    • A line containing two integers h (1 ≤ h ≤ 100) and s (0 ≤ s ≤ h(h + 1)), the number of layers in the pyramid and the number of strong people.

输出描述:

Output the number of possible ways to build a pyramid with the given constraints, modulo109 + 7.
示例1

输入

复制
3 3

输出

复制
3
示例2

输入

复制
5 3

输出

复制
14