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