/ OPS / 题库 /

Number Sequence

Number Sequence

#描述#
Define:An = X*An-1 + Y
<BR>
and Y mod (X-1) = 0.
<BR>
Your task is to calculate the smallest positive integer k that Ak mod A0 = 0.

#格式#
##输入格式##
Each line will contain only three integers X, Y, A0 ( 1 &lt X &lt 2^31, 0 &lt= Y &lt 2^63, 0 &lt A0 &lt 2^31).

##输出格式##
For each case, output the answer in one line, if there is no such k, output "Impossible!".

#样例1#
##样例输入1##

2 0 9

##样例输出1##

1

#限制#
1000ms
32768KB

#提示#

#来源#
zjut_DD

信息

ID
1633
难度
10
分类
category1 点击显示
标签
递交数
6
已通过
0
通过率
0%
上传者