#include <bits/stdc++.h>
using namespace std;
double d;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long double a, b;
    cin >> d;
    if (d > 0 && d < 4)
      cout << "N\n";
    else {
      if (d == 0)
        cout << "Y" << ' ' << 0.00000000 << ' ' << 0.00000000 << endl;
      else {
        long double seg = sqrt(d * (d - 4));
        a = (d + seg) / 2;
        b = (d - seg) / 2;
        cout << setprecision(12) << "Y" << ' ' << a << ' ' << b << endl;
      }
    }
  }
}
