#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    double l = 0.0;
    double r = n / 2.0;
    int cnt = 0;
    while (fabs(r - l) > 0.0000000001) {
      cnt++;
      if (cnt > 500) break;
      double mid = (l + r) / 2;
      if (mid * (n - mid) > n)
        r = mid;
      else
        l = mid;
    }
    double a = l;
    double b = n - l;
    if (fabs(n - l * (n - l)) < 0.000001)
      printf("Y %.9lf %.9lf\n", n - l, l);
    else
      printf("N\n");
  }
  return 0;
}
