Cruel Math Teacher
Time limit1sMemory limit128 MB
Compute N raised to the power P exactly, then print the result with 70 digits per line and no leading zeros.
- Level
Medium4 of 10
- Topics
- Math, Implementation, Array
- Solved
- No attempts yet
Problem
Bessie has returned to 8th grade to finish her diploma. Her cruel math teacher makes the students compute "powers of integers". The -th power of an integer is the value obtained by multiplying by itself times, written .
For example, .
Write a program that computes . The answer is guaranteed to have at most digits. Print the answer digits per line; only the last line may be shorter. Do not print any leading zeros.
Input
- Line 1: Two space-separated integers and (, ).
Output
- Print the value of , digits per line (the last line may be shorter). Do not print leading zeros.