#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
int main() {
  int t;
  double d, dt, a, b;
  scanf("%d", &t);
  while (t--) {
    scanf("%lf", &d);
    if (d < eps) {
      printf("Y 0.000000000 0.000000000\n");
      continue;
    }
    if (4 - d > eps) {
      printf("N\n");
      continue;
    }
    dt = d * d - 4 * d;
    a = (d - sqrt(dt)) / 2.0;
    b = d - a;
    printf("Y %.9f %.9f\n", b, a);
  }
}
