会计AI (CI翻译)
A long time ago in some far country lived king Copa. After the recent king's reform, he got so large powers that started to keep the books by himself.
很久以前,在某个遥远的国家里,住着国王 Copa。最近国王进行了一次改革,获得了极大的权力,于是开始亲自记账。AI (CI翻译)
The total income $*A*$ of his kingdom during $0$-th year is known, as well as the total income $*B*$ during $*n*$-th year (these numbers can be negative — it means that there was a loss in the correspondent year).
他的王国在第 $0$ 年的总收入 $*A*$ 已知,在第 $*n*$ 年的总收入 $*B*$ 也已知(这些数可以为负数——这意味着相应年份出现了亏损)。AI (CI翻译)
King wants to show financial stability. To do this, he needs to find common coefficient $*X*$ — the coefficient of income growth during one year. This coefficient should satisfy the equation:
国王希望展现出财政稳定性。为此,他需要找到一个公比 $*X*$,即每年收入增长的系数。该系数应满足以下等式:AI (CI翻译)
$*A*·*X*^{*n*} = *B*.$
$*A*·*X*^{*n*} = *B*.$AI (CI翻译)
Surely, the king is not going to do this job by himself, and demands you to find such number $*X*$.
当然,国王不打算亲自完成这项工作,因此要求你找出这样的数 $*X*$。AI (CI翻译)
It is necessary to point out that the fractional numbers are not used in kingdom's economy. That's why all input numbers as well as coefficient $*X*$ must be integers. The number $*X*$ may be zero or negative.
需要指出的是,这个国家的经济中不使用小数。因此,所有输入数字以及系数 $*X*$ 都必须是整数。数 $*X*$ 可以为零或负数。AI (CI翻译)
Input
输入格式
AI (CI翻译)The input contains three integers $*A*$, $*B*$, $*n*$ ($|*A*|, |*B*| ≤ 1000$, $1 ≤ *n* ≤ 10$).
输入包含三个整数 $*A*$、$*B*$、$*n*$($|*A*|, |*B*| ≤ 1000$,$1 ≤ *n* ≤ 10$)。AI (CI翻译)
Output
输出格式
AI (CI翻译)Output the required integer coefficient $*X*$, or «No solution», if such a coefficient does not exist or it is fractional. If there are several possible solutions, output any of them.
输出所需的整数系数 $*X*$;如果不存在这样的系数,或者该系数不是整数,则输出 «No solution»。如果有多个可能的解,输出其中任意一个即可。AI (CI翻译)
样例
2 18 2
3
-1 8 3
-2
0 0 10
5
1 16 5
No solution
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。