#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ const double prob{0.5}; int growthRateOne{0}; cin >> growthRateOne; int growthRateTwo{0}; cin >> growthRateTwo; unsigned long long int growthTime{0}; cin >> growthTime; int base{int(prob*(growthRateOne + growthRateTwo))}; vector binaryTime; while(growthTime != 0){ binaryTime.push_back(growthTime%2); growthTime = growthTime >> 1; } long long int module{1000000007}; long long int cells{1}; const int length = binaryTime.size(); for(int bit = length-1; bit >= 0; bit--){ cells = cells*cells%module; if(binaryTime[bit] == 1) cells = cells*base%module; } cout << cells; return 0; }