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