#include <bits/stdc++.h>
int main() {
  int n, i, t;
  scanf("%d", &t);
  for (; t > 0; t--) {
    scanf("%d", &n);
    if (n == 0)
      printf("Y 0.000000 0.000000\n");
    else if (n < 4) {
      printf("N\n");
    } else {
      double x, dn;
      x = sqrt(n * n - 4 * n);
      dn = n;
      printf("Y %.9lf %.9lf\n", (dn + x) / 2, (dn - x) / 2);
    }
  }
  return 0;
}
