#include #include #include #include #include using namespace std; int power(int x, int y, int mod) { int result = 1; x = x % mod; while(y > 0) { if(y %2 == 1) { result = result * x % mod; } y = y/2; x = (x * x) % mod; } return result; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int aFactor, bFactor, milliseconds; cin >> aFactor >> bFactor >> milliseconds; int day1 = (aFactor + bFactor) / 2; long modulo = pow(10, 9) + 7; cout << power(day1, milliseconds, modulo) << endl; return 0; }