#include #include #include #include #include using namespace std; long power(long x, unsigned long y, long p) { long res = 1; // Initialize result x = x % p; // Update x if it is more than or // equal to p while (y > 0) { // If y is odd, multiply x with result if (y & 1) res = (res*x) % p; // y must be even now y = y>>1; // y = y/2 x = (x*x) % p; } return res; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long a = 0, b = 0, t = 0; cin >> a; cin >> b; cin >> t; long spread = power(0.5 * (a + b), t, 1000000007); cout << spread; return 0; }