How i can solve this problem, Lucky Number

Правка en1, от Cat.Noir, 2024-02-21 02:44:39

You're given $$$a$$$, $$$b$$$. the Lucky Number is the sum of first 3 digits and last 3 digits of $$$a^{b}$$$ $$$(a \leq 2 \times 10^{9})$$$ $$$(b \leq 10^{7})$$$,

It is guaranteed that $$$a^{b}$$$ contains at least $$$6$$$ digits.

Example if $$$a = 6$$$ and $$$b = 7$$$.
$$$a^{b} = 279936$$$ Lucky Number is $$$279 + 936 = 1215$$$

input : $$$a = 24, b = 13$$$ Output : $$$1700$$$
input : $$$a = 153456, b = 3$$$ Output : $$$1177$$$

Теги number theory, modulo

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Cat.Noir 2024-02-21 02:44:39 444 Initial revision (published)