Codeforces Round 281 (Div. 2)
E
Vasya and Polynomial
Codeforces
2800
原题
← D→
翻译中…

Vasya is studying in the last class of school and soon he will take exams. He decided to study polynomials. Polynomial is a function $*P*(*x*) = *a*_{0} + *a*_{1}*x*^{1} + ... + *a*_{*n*}*x*^{*n*}$. Numbers $*a*_{*i*}$ are called coefficients of a polynomial, non-negative integer $*n*$ is called a degree of a polynomial.

翻译中…

Vasya has made a bet with his friends that he can solve any problem with polynomials. They suggested him the problem: "Determine how many polynomials $*P*(*x*)$ exist with integer non-negative coefficients so that image, and image, where image and $*b*$ are given positive integers"?

翻译中…

Vasya does not like losing bets, but he has no idea how to solve this task, so please help him to solve the problem.

翻译中…

Input

翻译中…

The input contains three integer positive numbers image no greater than $10^{18}$.

翻译中…

Output

翻译中…

If there is an infinite number of such polynomials, then print "inf" without quotes, otherwise print the reminder of an answer modulo $10^{9} + 7$.

翻译中…

样例

Input #1
2 2 2
Output #1
2
InputCopy OutputCopy
Input #2
2 3 3
Output #2
1
InputCopy OutputCopy
题目信息
题号
493E
时间限制
2 s
内存限制
256 MB
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。