题目链接:http://acm.henu.edu.cn/contest/problem?id=2&pid=2
#include <bits/stdc++.h>
using namespace std;
#define LL long long
int main()
{
LL a, b, n;
while (cin >> a >> b >> n)
{
LL x = a, y = 1;
for (int i = 2; i <= n; i++)
{
LL prex = x, prey = y;
x = a * prex + b * prey;
y = prex + a * prey;
}
cout << x << " " << y << endl;
}
return 0;
}