#include <bits/stdc++.h>
using namespace std;
struct Testcase {
  double n;
  Testcase(int n) : n(n){};
  pair<double, double> solve(bool &status) {
    pair<double, double> a = {0, n};
    status = true;
    double m = n / 2;
    if (m * m < n) {
      status = false;
      return a;
    }
    if (m * m == n) {
      return {m, m};
    }
    double lo = 0, hi = m;
    for (int i = 0; i < 100; ++i) {
      double mid = (lo + hi) / 2;
      double res = mid * (n - mid);
      if (res == n) {
        return {mid, n - mid};
      } else if (res < n) {
        lo = mid;
      } else if (res > n) {
        hi = mid;
      }
    }
    return {lo, n - lo};
  }
};
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    int n;
    cin >> n;
    bool status = true;
    auto [a, b] = Testcase(n).solve(status);
    if (not status) {
      cout << "N" << endl;
    } else {
      cout << fixed << setprecision(15) << "Y " << a << " " << b << endl;
    }
  }
}
