fork(1) download
  1. #include <bits/stdc++.h>
  2. #include <iostream>
  3. using namespace std;
  4. #define Deghish ios_base::sync_with_stdio(false);cin.tie(NULL);
  5. double EPS=1e-10;
  6. void solve() {
  7. double d;cin>>d;
  8. if (d > 0 && d < 4) {
  9. cout << "N" << endl;
  10. return;
  11. }
  12. double aa,bb;
  13. double l=0,h=d/2;
  14. while (h-l>EPS) {
  15. double mid=(l+h)/2.0;
  16. double a=d-mid;
  17. double b=mid;
  18.  
  19. if (a*b<=d) {
  20. aa=a,bb=b;
  21. l=mid;
  22. }else {
  23. h=mid;
  24. }
  25. }
  26. cout<<fixed<<setprecision(9)<<"Y "<<aa<<" "<<bb<<endl;
  27. }
  28. signed main() {
  29. Deghish
  30. int Tc = 1;//
  31. cin >> Tc;
  32. while (Tc--) {
  33. solve();
  34. }
  35. return 0;
  36. }
  37.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Y 0.000000000 0.000000000