All problems

Problem 795

Power of a Number

Easy · 10 pts · Math, Basics

Problem

Compute A raised to the power B, that is, A multiplied by itself B times, and print the exact result. Any number to the power 0 is 1 (including 0^0, which we define as 1 here). A negative base gives a negative result for odd B. The result can be as large as 10^30, so use big integers (BigInteger in Java; Python handles it natively).

Input

A single line with two integers A and B.

Output

Print A^B exactly.

Constraints

-10 <= A <= 10; 0 <= B <= 30

Example input

2 10

Example output

1024

Explanation

2^10 = 2 × 2 × ... × 2 (ten times) = 1024. For A = -3 and B = 3 the answer would be -27.

Every problem here can be used in a RelayTrixCode team match. Create a room.

Previous: Sum of Positive Numbers Next: Print Numbers from 1 to N