#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    double x, y, z, a, b, c, sq;
    cin >> x;
    a = 1.0, b = x, c = x;
    z = (b * b) - (4 * a * c);
    if (z < 0) {
      cout << "N" << endl;
      continue;
    }
    y = ((-b + (sqrt((b * b) - (4 * a * c)))) / 2 * a);
    if (y != 0) y = -1 * y;
    cout << fixed << setprecision(9) << "Y " << (x - y) << " " << y << endl;
  }
}
