Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <set>
- #include <map>
- #include <algorithm>
- #include <string>
- #include <math.h>
- #include <vector>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n, x, pol= 100000, at=-100000;
- cin >> n >> x;
- for (int i = 1; i <= n; i++)
- {
- int prom;
- cin >> prom;
- if (prom > 0)
- if (prom < pol)
- pol = prom;
- else;
- else
- if (prom > at)
- at = prom;
- else;
- }
- if (at < x&&x < pol)
- if(x>0)
- cout << x << " " << abs(at) + abs(at) + x;
- else
- cout << abs(pol + pol - x) << " " << abs(x);
- else
- cout << "Impossible";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment