#include <bits/stdc++.h>
using namespace std;
double thresh = (double)(0.0000000003);
double srch(double start, double end, double d) {
  double mid = (start + end) / (2.0);
  if (start == end) {
    return start;
  }
  if (abs(mid * mid - d) <= thresh) {
    return mid;
  } else if (mid * mid < d) {
    return srch(mid, end, d);
  } else
    return srch(start, mid, d);
}
int main() {
  cout << fixed;
  cout << setprecision(12);
  int i, j, t, d;
  cin >> t;
  for (i = 1; i <= t; i++) {
    cin >> d;
    int temp = (d - 4) * d;
    if (temp < 0) {
      cout << 'N' << endl;
      continue;
    } else {
      cout << "Y"
           << " ";
    }
    int sqrt1 = sqrt(temp);
    if (sqrt1 * sqrt1 != temp) {
      double sqrtf;
      sqrtf = (double)srch(sqrt1, sqrt1 + 1, temp);
      cout << (d + sqrtf) / 2 << " " << (d - sqrtf) / 2 << endl;
    } else {
      cout << (d + sqrt1) / 2 << " " << (d - sqrt1) / 2 << endl;
    }
  }
}
