#include <bits/stdc++.h>
using namespace std;
long long small(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return i;
    }
  }
  return n;
}
signed main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    double d;
    cin >> d;
    double p = (d * d - 4 * d);
    cout << fixed << setprecision(9);
    if (d == 0) {
      cout << "Y " << 0.000000000 << " " << 0.000000000 << endl;
      continue;
    }
    if (d == 4) {
      cout << "Y " << 2.000000000 << " " << 2.000000000 << endl;
      continue;
    }
    if (p < 1e-9) {
      cout << "N" << endl;
      continue;
    }
    p = sqrt(p);
    double x1 = (d + p) / 2;
    double x2 = (d - p) / 2;
    cout << "Y"
         << " ";
    cout << x1 << " " << x2 << endl;
  }
}
