Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7. int x, y, k;
  8. cin >> x >> y;
  9. if(x < y)
  10. return cout << "-1", 0;
  11. k = (y+x)/y;
  12. if(k%2 == 1)
  13. k--;
  14. cout.precision(18);
  15. cout.fixed;
  16. cout << double(x+y)/double(k);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement