Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/rekursiya-darajaga-kotarish

A to the power N

Easy 1000 ms 64 MB 25%
Share

You are given two integers $a$ and $n$. Using a recursive function, compute $a^n$:

$$a^0 = 1$$
$$a^n = a \times a^{n-1} \quad (n \ge 1)$$

The exponent decreases by one in every call, and the values return from the bottom up

Input

One line with two integers $a$ and $n$ separated by a space ($1 \le a \le 10$, $0 \le n \le 9$).

Output

The value of $a^n$.

Note

$1 \le a \le 10$, $0 \le n \le 9$. The result does not exceed $10^9$.

Examples

Input #1
2 3
Output #1
8
Input #2
5 0
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.