#include using namespace std; constexpr int T = 52, N = 10; int convert(int x) { const int r = x % 10; if (r == 0) return x; if (r <= 3) return x + 3 - r; if (r <= 6) return x + 6 - r; return x + 10 - r; } int main() { int t, n, money; cin >> t >> n >> money; money /= 500; array s, p, r; s.fill(0); p.fill(0); r.fill(0); for (int week = 0; week < T; week++) { cout << 1; for (int i = 0; i < 10; i++) { cout << ' ' << min(money / 10, max(0, convert(1.5 * pow(1.05, 3 * p.at(i))) - r.at(i))); } cout << endl; cin >> money; money /= 500; for (auto &&x : s) { cin >> x; } for (auto &&x : p) { cin >> x; } for (auto &&x : r) { cin >> x; } } return 0; }