#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, in;
  double ch, tmp;
  cin >> t;
  while (t--) {
    cin >> in;
    double a, b, d;
    ch = in * in - 4 * in;
    d = (double)in;
    if (ch < double(0)) {
      cout << "N" << endl;
      continue;
    } else {
      a = (double(d) + sqrt(double(ch))) / (double)2;
      b = (double(d) - sqrt(double(ch))) / (double)2;
      cout << "Y"
           << " " << fixed << setprecision(9) << a << " " << fixed
           << setprecision(9) << b << endl;
    }
  }
  return 0;
}
