No.1275 Beautiful Expression
問題文最終更新日: 2021-05-08 01:03:51
English (AI translation)
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
Problem Statement
Find $\displaystyle \left( a+\sqrt{b} \right)^n + \left( a-\sqrt{b} \right)^n$.
Since this value can be very large, output it modulo $10^9+7$.It is guaranteed that this value is an integer.
Input
$a\ b$ $n$
Output
Print a newline at the end.
Sample
Sample 1
Input
2 4 2
Output
16
Sample 2
Input
1 16 5
Output
2882
Sample 3
Input
111 111 111
Output
370378144
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
57tggx