An easy problem,help - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

An easy problem,help

Nemanja1234Nemanja1234 Posts: 2Member
For the given numbers O, S, M calculate the Sth exponent of number O, with modulus M.

INPUT:
The first and only line of the standard input contains the numbers O, S, M. (0 < O <= 2000000000), (0 < S <= 20000000000). (0 < M <= 4000).

OUTPUT:
To the standard output write one number that is the result of (O^S) mod M.

Input:
2 10 10

Output:
4

Explanation:
(2 ^ 10) mod 10 = 1024 mod 10 = 4

Time: 0.1 sec.
Can u help me plz
Sign In or Register to comment.