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