P26899 [AtCoder] Geometric Sequence
提高-
题目描述

Problem Description

Given the first term \( A \) and the common ratio \( R \) of a geometric sequence, output the \( N \)-th term if it is less than or equal to \( 10^9 \). If it is greater than \( 10^9 \), output large.

Input Format

The input is given from the standard input in the following format:

\( A \) \( R \) \( N \)

Output Format

Output the specified value or string as per the problem.

Sample Input and Output

Sample Input #1

2 3 4

Sample Output #1

54

Sample Input #2

4 3 21

Sample Output #2

large

Sample Input #3

12 34 5

Sample Output #3

16036032

Notes/Hints

Constraints

  • All inputs are integers.
  • \( 1 \leq A, R, N \leq 10^9 \)

Sample Explanation 1

The geometric sequence with the first term \( 2 \) and common ratio \( 3 \) is \( 2, 6, 18, 54, \ldots \). The 4th term is \( 54 \), so output \( 54 \).

Sample Explanation 2

The 21st term of the geometric sequence with the first term \( 4 \) and common ratio \( 3 \) is \( 13947137604 \), which is greater than \( 10^9 \), so output large.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 3 4
样例输出
54