#include #include #include #include #include #include using namespace std; const unsigned int x = 1000000007; unsigned long square(long x) { return x * x; } unsigned long power(long result, long t) { if (t == 0) return 1; else if (t % 2 == 0) return square(power(result, t/2)) % x; // square(x) = x * x else return ((result % x) * power(result, t-1)) % x; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long a, b, t; long result; cin >> a >> b >> t; result = (a + b) / 2; cout << power(result, t) << endl; return 0; }