#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double e = 1e-6;
int main() {
  int T;
  double n;
  scanf("%d", &T);
  while (T--) {
    scanf("%lf", &n);
    double a = 0, b = n;
    bool flag = false;
    for (int i = 0; i < 10000; i++) {
      double m = (a + b) / 2, d = n - m;
      if (m * d - m - d > 1e-9)
        b = m;
      else if (m + d - d * m > 1e-9)
        a = m;
    }
    double m = (a + b) / 2, d = n - m;
    if (m + d - n <= e && m + d - n >= -e && (m + d) - m * d <= e &&
        (m + d) - m * d >= -e && m * d - n <= e && m * d - n >= -e)
      printf("Y %.9lf %.9lf\n", d, m);
    else
      puts("N");
  }
  return 0;
}
