2260 SuperSum
Time Limit : 2000/1000 MS(Java/Others) | Memory Limit : 131072/65536 KB(Java/Others)
Submits : 1113 | Solved : 467
Description
SuperSum is a function defined as:
SuperSum(0 , n) = n, for all positive n.
SuperSum(k , n) = SuperSum(k-1 , 1) + SuperSum(k-1 , 2) + ... + SuperSum(k-1 , n), for all positive k, n.
Given k and n, return the value for SuperSum(k , n).
Constraints
-
k will be between 1 and 14, inclusive.
-
n will be between 1 and 14, inclusive.
Input
One line with two numbers k n.
Output
One line SuperSum(k,n).
Sample Input
1
3
2
3
4
10
10
10
Sample Output
6
10
2002
167960
HINT
Source
TopCoder
[ Top ] | [ Submit ] | [ Statistics ] | [ Standing ]