Jeremiah_

ABC_127 - B - Algae

May 27th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define endl '\n';
  6.  
  7. int main () {
  8.  ios::sync_with_stdio(0);
  9.  
  10.   int r, d;
  11.   long int val;
  12.   vector <long int> ans;
  13.   cin >> r >> d >> val;
  14.   for (int i = 0; i < 10; ++i) {
  15.     val  = r*val - d;
  16.     ans.push_back(val);
  17.   }
  18.   sort(ans.begin(), ans.end());
  19.   for (auto i : ans) {
  20.     cout << i << endl;
  21.   }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment