#include #include #include #include unsigned long int decrypt2(int a,int b,int n) { unsigned long int res; if (b == 0) { res = 1; } else if (b % 2 == 1) { res = a * decrypt2( a, b-1, n ); } else { res = decrypt2( a, b/2, n ); res = (res*res)%n; } return res; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ unsigned int a,b; unsigned long int t; const unsigned long int modulus = 1000000007; scanf("%d%d%ul",&a,&b,&t); a = 0.5*(a+b); printf("%d",decrypt2(a,t,modulus)); return 0; }