#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ unsigned long long N = 0; unsigned t, A, B; cin >> A >> B >> t; for (unsigned T = 1; T <= t; ++T) { N += 0.5 * A + 0.5 * B; } cout << N % 1000000007 << endl; return 0; }