#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b, d;
  int n;
  scanf("%d", &n);
  while (n--) {
    scanf("%lf", &d);
    if (d < 4 && d != 0)
      printf("N\n");
    else
      printf("Y %.10f %.10f\n", (d - sqrt(d * d - 4 * d)) / 2,
             (d + sqrt(d * d - 4 * d)) / 2);
  }
  return 0;
}
