CF301E.Yaroslav and Arrangements
普及/提高-
通过率:0%
时间限制:3.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Yaroslav calls an array of r integers _a_1, _a_2, ..., a__r good, if it meets the following conditions: |_a_1 - _a_2| = 1, |_a_2 - _a_3| = 1, ..., |a__r - 1 - a__r| = 1, |a__r - _a_1| = 1, at that
.
An array of integers _b_1, _b_2, ..., b__r is called great, if it meets the following conditions:
- The elements in it do not decrease (b__i ≤ b__i + 1).
- If the inequalities 1 ≤ r ≤ n and 1 ≤ b__i ≤ m hold.
- If we can rearrange its elements and get at least one and at most k distinct good arrays.
Yaroslav has three integers n, m, k. He needs to count the number of distinct great arrays. Help Yaroslav! As the answer may be rather large, print the remainder after dividing it by 1000000007 (109 + 7).
Two arrays are considered distinct if there is a position in which they have distinct numbers.
雅罗斯拉夫称一个由 r 个整数组成的数组 a1,a2,…,ar 是好的,如果它满足以下条件:
∣a1−a2∣=1, ∣a2−a3∣=1, …, ∣ar−1−ar∣=1, ∣ar−a1∣=1,
且此时
。
一个由整数组成的数组 b1,b2,…,br 被称为极好的,如果它满足以下条件:
- 数组中元素不递减(即对所有 i,有 bi≤bi+1);
- 满足不等式 1≤r≤n 和 1≤bi≤m;
- 其元素经重排后,能构成至少一个、至多 k 个互不相同的“好的”数组。
雅罗斯拉夫拥有三个整数 n、m、k。他需要计算出互不相同的“极好的”数组的个数。请帮助雅罗斯拉夫!由于答案可能非常大,请输出其对 1000000007(即 109+7)取模的结果。
若两个数组在某个位置上的数值不同,则认为它们是互不相同的数组。
输入格式
The single line contains three integers n, m, k (1 ≤ n, m, k ≤ 100).
单行包含三个整数 n、m、k(1 ≤ n, m, k ≤ 100)。
输出格式
In a single line print the remainder after dividing the answer to the problem by number 1000000007 (109 + 7).
在一行中输出该问题答案对 1000000007(即 109+7)取模后的余数。
输入输出样例
输入#1
1 1 1
输出#1
0
输入#2
3 3 3
输出#2
2
输入解题思路,AI测评打分。不知道怎么写?