# ๋ฐ์ด๋ฌ์ค 1์ด๋น P๋ฐฐ์ฉ ์ฆ๊ฐ
# ์ฒ์ K๋ง๋ฆฌ n์ดํ -> ๋ช๋ง๋ฆฌ?
# k:๋ฐ์ด๋ฌ์ค ์ , P:์ฆ๊ฐ์จ , N:์ด ์๊ฐ
k,p,n = map(int,input().split())
result = k
for _ in range(n):
a = result % 1000000007
b = p % 1000000007
result = (a*b) % 1000000007
print(result)
(a*b) % m = ( (a%m) * (b%m) ) % m
https://sskl660.tistory.com/75
'Algorithm > Softeer' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Softeer - level2] ๊ธ๊ณ ํธ์ด (0) | 2023.07.25 |
---|---|
[Softeer - level2] ์ง๋ ์๋ ๊ตฌ์ถ (0) | 2023.07.25 |
[Softeer - level2] 8๋จ ๋ณ์๊ธฐ (0) | 2023.07.25 |
[Softeer - level3] ์ค๋งํธ ๋ฌผ๋ฅ (0) | 2023.07.24 |
[Softeer - level3] ํ๋ฐฐ ๋ง์คํฐ ๊ด์ฐ (0) | 2023.07.24 |