C - Geometric Progression Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 8

注意

この問題に対する言及は、2020/6/6 18:00 JST まで禁止されています。言及がなされた場合、賠償が請求される可能性があります。 試験後に総合得点や認定級を公表するのは構いませんが、どの問題が解けたかなどの情報は発信しないようにお願いします。

問題文

初項 A、公比 R の等比数列の第 N 項が 10^9 より大きければ large を、10^9 以下ならその値を整数で出力してください。

制約

  • 入力はすべて整数
  • 1 \leq A, R, N \leq 10^9

入力

入力は以下の形式で標準入力から与えられる。

A R N

出力

問題で指定された値または文字列を出力せよ。


入力例 1

2 3 4

出力例 1

54

初項 2、公比 3 の等比数列は 2, 6, 18, 54, \ldots です。これの第 4 項は 54 であるため、54 を出力します。


入力例 2

4 3 21

出力例 2

large

初項 4、公比 3 の等比数列の第 21 項は 13947137604 であり、これは 10^9 より大きいため、large を出力します。


入力例 3

12 34 5

出力例 3

16036032

Score : 8 points

Warning

Do not make any mention of this problem until June 6, 2020, 6:00 p.m. JST. In case of violation, compensation may be demanded. After the examination, you can reveal your total score and grade to others, but nothing more (for example, which problems you solved).

Problem Statement

Consider the N-th term of a geometric sequence with the initial value of A and the common ratio of R. If it is greater than 10^9, print large; otherwise, print its value as an integer.

Constraints

  • All values in input are integers.
  • 1 \leq A, R, N \leq 10^9

Input

Input is given from Standard Input in the following format:

A R N

Output

Print a value or a string as specified in Problem Statement.


Sample Input 1

2 3 4

Sample Output 1

54

The geometric sequence with the initial value of 2 and the common ratio of 3 is: 2, 6, 18, 54, \ldots. Its fourth term is 54, so we should print 54.


Sample Input 2

4 3 21

Sample Output 2

large

The 21-st term of a geometric sequence with the initial value of 4 and the common ratio of 3 is 13947137604, which is greater than 10^9. Thus, we should print large.


Sample Input 3

12 34 5

Sample Output 3

16036032