CF30A.Accounting

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

The total income AA of his kingdom during 00 -th year is known, as well as the total income BB during nn -th year (these numbers can be negative — it means that there was a loss in the correspondent year).

King wants to show financial stability. To do this, he needs to find common coefficient XX — the coefficient of income growth during one year. This coefficient should satisfy the equation:

AXn=B.A·X^{n}=B. Surely, the king is not going to do this job by himself, and demands you to find such number XX .

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 XX must be integers. The number XX may be zero or negative.

输入格式

The input contains three integers AA , BB , nn ( A,B<=1000|A|,|B|<=1000 , 1<=n<=101<=n<=10 ).

输出格式

Output the required integer coefficient XX , or «No solution», if such a coefficient does not exist or it is fractional. If there are several possible solutions, output any of them.

输入输出样例

  • 输入#1

    2 18 2
    

    输出#1

    3
  • 输入#2

    -1 8 3
    

    输出#2

    -2
  • 输入#3

    0 0 10
    

    输出#3

    5
  • 输入#4

    1 16 5
    

    输出#4

    No solution
首页