#include #include #include #include /* Function to calculate x raised to the power y in O(logn)*/ unsigned long power(unsigned long x, unsigned long y) { unsigned long temp; unsigned long d = 1000000007; if( y == 0) return 1; temp = power(x, y/2); if (y%2 == 0) return temp*temp % 1000000007; else return x*(temp*temp % 1000000007)% 1000000007; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ unsigned long a; unsigned long b; unsigned long t; unsigned long v; unsigned long r; scanf("%ld %ld %ld", &a, &b, &t); //printf("%ld", t); v=(0.5*a + 0.5*b); r = power(v, t); printf("%ld", r); return 0; }