B2144 阿克曼(Ackermann)函数

题目描述

阿克曼(Ackermann)函数 $A(m,n)$ 中,$m, n$ 定义域是非负整数($m \le 3$,$n \le 10$),函数值定义为: $\mathit{A}(m,n)=n+1$;($m=0$ 时)。 $\mathit{A}(m,n)=\mathit{A}(m-1,1)$;($m>0$、$n=0$ 时)。 $\mathit{A}(m,n)=\mathit{A}(m-1,\mathit{A}(m,n-1))$;($m,n>0$ 时)。

输入格式

$m$ 和 $n$。

输出格式

函数值。