#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int a = 0, b = 0, t = 0; int cells = 1; double prob = 0.5; std::cin >> a >> b >> t; while( t > 0 ){ cells += prob*a*cells + prob*b*cells; t--; } std::cout << cells-1 % 1000000007; return 0; }