#include #include #include #include #include using namespace std; #define MODVAL 1000000007 long long func(long long base, long long k, long long mod) { //cout << base << " " << k << " " << mod << endl; long long res = 1; long long i; for (i = 1; iMODVAL) break; } long long inter = k / i; long long inter_mode = k%i; if (i == k + 1){ return (res*mod) % MODVAL; } else{ long long tmp = 1; for (long long ii = 1; iiMODVAL) { res = res%MODVAL; } } return res; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long long a, b, time; cin >> a; cin >> b; cin >> time; //a = 2; //b = 4; //time = 2675423; unsigned long long ret = 1; int base = (a + b) / 2; cout << func(base, time, 1); //cin >> a; }