Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main() {
- int p1, p2, p3;
- cin >> p1 >> p2 >> p3;
- int x = p2 - p1;
- if(p2 + x == p3) {
- cout << p3 + x << endl;
- }
- else {
- x = p2 / p1;
- cout << p3 * x << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement