Problem1072-- V1080 Function(Function(F...

1072: V1080 Function(Function(F...

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Status] [Submit] [Creator:]

Description

对于一个递归函数w(a,b,c)

如果a< =0  or  b< =0  or  c< =0就返回值1.
如果a> 20  or  b> 20  or  c> 20就返回w(20,20,20)
如果a< b并且b< c  就返回w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c)
其它别的情况就返回w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1,b-1,c-1)

这是个简单的递归函数,但实现起来可能会有些问题。当a,b,c均为15时,调用的次数将非常的多。你要想个办法才行.

Input

会有若干行. 并以-1,-1,-1结束.

Output

输出若干行

Sample Input Copy

1 1 1
2 2 2
-1 -1 -1

Sample Output Copy

w(1, 1, 1) = 2
w(2, 2, 2) = 4

Source/Category