#45378: 濾掉錯答


x__1 (^_^ 809-34)

學校 : 臺北市立麗山國中
編號 : 294220
來源 : [111.248.235.102]
最後登入時間 :
2025-08-04 11:16:52

b,a=1,0
p,n=map(int,input().split())
while n:
 if n&1:
  a+=b
 n>>=1
 b*=p
print(a%(1<<32))