Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <string>
- #include <map>
- #include <set>
- #include <algorithm>
- #include <vector>
- #include <stdio.h>
- #include <cmath>
- #include <math.h>
- #include <queue>
- #include <stack>
- #include <climits>
- #include <deque>
- #include <ctime>
- using namespace std;
- typedef long long ll;
- typedef unsigned long long ull;
- typedef unsigned int ui;
- #define mh() make_heap()
- #define poph() pop_heap()
- #define pushh() push_heap()
- #define sor(n) n.begin(), n.end()
- #define mp make_pair
- ll Round(double k)
- {
- if (ll(k*10)%10 < 0.5)
- return int(k) + 1;
- else
- return int(k);
- }
- int main()
- {
- double a, b, e, d;
- cin >> a >> b >> d >> e;
- double answ;
- if (abs(a*b - d*e) < 1e-9)
- cout << "Impossible.";
- else
- {
- answ = sqrt(d*d + e*e - d*e*((a*a + b*b - d*d - e*e) / (a*b - d*e)));
- answ *= 1000;
- printf("Distance is %.0f km.", answ);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement