#include #include #include #include unsigned long long expoModulo(unsigned long long a, unsigned long long b, unsigned long long modulo){ if(b==0) return 1; unsigned long long temp=expoModulo(a,b/2,modulo)%modulo; if(b%2) return (((a*temp)%modulo)*temp)%modulo; return (temp*temp)%modulo; } int main() { unsigned long long a,b; unsigned long long t,j,i,modulo; unsigned long long resultat; scanf("%llu %llu %llu",&a,&b,&t); if(t==0){ printf("0"); return 0; } unsigned long long mul=(a+b)/2; if (!mul){ printf("0"); return 0; } resultat=expoModulo(mul,t,1000000007); printf("%llu",resultat); return 0; }