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