問題一覧 > 通常問題

No.673 Beetles

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 142
作問者 : nmnmnmnmnmnmnm / テスター : tanzaku
お気に入りにしたユーザー ProblemId : 767 / 自分の提出
問題文最終更新日: 2026-06-26 06:07:22
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 188 (順位表) の他の問題:

Problem Statement

Every year, without fail, A-kun buys B beetles on January 1st.
When he counts them on New Year's Eve, December 31st, the number has grown to C times the number present on January 1st.
If he buys B beetles on January 1st of year 1, there are B $\times$C beetles on New Year's Eve.
On January 1st of year 2 there are B $\times$C+B beetles, and on New Year's Eve there are (B $\times$C+B) $\times$C beetles.
How many beetles are there on New Year's Eve of year D?

However, output the answer modulo 1000000007.

Input

B C D

B, C, and D are all positive integers.
$1 \le$ B,C,D $\le 1000000000000=10^{12}$.

Output

Output on one line the number of beetles on New Year's Eve of year D, modulo 1000000007.
Print a newline at the end.

Sample

Sample 1
Input
1 2 3
Output
14

In year 1, he buys 1 beetle on January 1st, and on New Year's Eve it has doubled to 2 beetles.
In year 2, he buys 1 beetle on January 1st, for a total of 3 beetles. On New Year's Eve this has doubled to 6 beetles.
In year 3, he buys 1 beetle on January 1st, for a total of 7 beetles. On New Year's Eve this has doubled to 14 beetles.

Sample 2
Input
100 1 100
Output
10000

He buys 100 more beetles each year for 100 years, so there are 10000 beetles.

Sample 3
Input
123 456 789
Output
198020583

Sample 4
Input
1000000000000 1000000000000 1000000000000
Output
214111862

This is the maximum case.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。