#include using namespace std; int main() { int x, s, p, h, y = 0; cin >> x >> s >> p >> h; for (int i = 0; i < h; ++i) { if (x >= 1000) { x += (s + p) * (x / 100); } else { x += s * (x / 100); } y += x % 100; x -= x % 100; if (y / 100 >= 1) { y -= 100; x += 100; } cout << x << " " << y << endl; } }