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