#t335. 阿克曼(Ackmann)函数

阿克曼(Ackmann)函数

The Ackmann Function

Problem Background

Special for beginners, ^_^

Problem Description

For the Ackmann function A(m,n)A(m,n), m,nm,n are non-negative integers (m≤3,  n≤10)(m\le 3,\;n\le 10). The function is defined as:

$$\nA(m,n)=\n\begin{cases}\nn+1, &m=0\\\\\nA(m-1,1),&m>0,n=0\\\\\nA(m-1,A(m,n-1)) &m,n>0\n\end{cases}\n$$

Input Format

Input mm and nn.

Output Format

The value of A(m,n)A(m,n).

Sample Input

2 3

Sample Output

9

Constraints

1s, 1024KiB for each test case.