#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    double n;
    cin >> n;
    if (n < 4 and n > 0) {
      cout << "N" << endl;
      continue;
    }
    double a, b;
    double q = n * n - 4 * n;
    q = sqrt(q);
    a = (n + q) / 2;
    b = (n - q) / 2;
    cout << "Y " << fixed << setprecision(10) << a << " " << b << endl;
  }
  return 0;
}
