Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define endl '\n';
- int main () {
- ios::sync_with_stdio(0);
- int r, d;
- long int val;
- vector <long int> ans;
- cin >> r >> d >> val;
- for (int i = 0; i < 10; ++i) {
- val = r*val - d;
- ans.push_back(val);
- }
- sort(ans.begin(), ans.end());
- for (auto i : ans) {
- cout << i << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment