#include using namespace std; int a, b, n; int main() { #ifndef ONLINE_JUDGE freopen("data.in", "r", stdin); freopen("data.out", "w", stdout); #endif // ONLINE_JUDGE ios::sync_with_stdio(0); cin >> a >> b >> n; if (n == 2) { cout << a + b << ' ' << a * 2 + b; return 0; } int i = log2(n - 1); cout << a + b << ' ' << 1LL * a * (2 * i + 1) + b; }