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