Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main(){
- int x, y, k;
- cin >> x >> y;
- if(x < y)
- return cout << "-1", 0;
- k = (y+x)/y;
- if(k%2 == 1)
- k--;
- cout.precision(18);
- cout.fixed;
- cout << double(x+y)/double(k);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement