#include #include #include #include long int modularPow(long base, long exponent, long modulus); int main() { int a, b; long int t; scanf("%i %i %li", &a, &b, &t); printf("%li", modularPow((a+b)/2, t, 1000000007)); return 0; } long int modularPow(long base, long exponent, long mod){ int result = 1; while (exponent > 0){ if (exponent % 2 == 1) result = (result * base) % mod; exponent /= 2; base = (base * base) % mod; } return result; }