Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int t;
- cin >> t;
- for (int z = 0; z < t; z++)
- {
- int x, y, k, t, c = 0, i = 0;
- cin >> x >> y >> k >> t;
- while (i <= t && c < k)
- {
- if (x % y)
- {
- x += y - (x % y);
- c++;
- }
- i++;
- x++;
- }
- cout << x;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement