#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
namespace Sa {
struct Node {
  double x, y;
  Node() {}
  Node(double x, double y) : x(x), y(y) {}
  Node operator-(Node a) const { return Node(x - a.x, y - a.y); }
  double operator*(Node a) const { return x * a.y - y * a.x; }
} a[1], b[1];
double l, r, Mid, Ans, Now, x, y, Ax, T, N2;
int i, j, k, n, m;
inline double Getrand() { return rand() % 1000 / 1000.0; }
inline double Gety(double x) {
  for (int i = 1; i < n; i++)
    if (a[i + 1].x > x)
      return (a[i + 1].y - a[i].y) / (a[i + 1].x - a[i].x) * (x - a[i].x) +
             a[i].y;
}
inline bool Check(Node A) {
  for (int i = 1; i < n; i++)
    if ((A - a[i]) * (A - a[i + 1]) < 0) return 0;
  return 1;
}
inline double Calc(double x) {
  double l = 0, r = 0, Mid;
  while (r - l > 1) {
    Mid = (l + r) / 2.0;
    if (Check(Node(x, Mid)))
      r = Mid;
    else
      l = Mid;
  }
  l -= Gety(x);
  if (l < Ans) Ans = l, Ax = x;
  return l;
}
inline void SA(double T) {
  for (; T > 0.00001; T *= 0.99) {
    y = x + T * (Getrand() * 2 - 1);
    if (y < a[1].x || y > a[n].x) continue;
    N2 = Calc(x) - Calc(y);
    if (N2 > 0 || exp(N2 / T) > Getrand()) x = y;
  }
  for (int i = 1; i <= 1000; i++) {
    y = Ax + T * (Getrand() * 2 - 1);
    if (y < a[1].x || y > a[n].x) continue;
    Calc(y);
  }
}
}  // namespace Sa
int main() {
  int t = read();
  while (t--) {
    int n = read();
    double T = n;
    if (n * n < 4 * n) {
      printf("N\n");
      continue;
    }
    double a = (T + sqrt(T * T - 4.0 * T)) / 2.0;
    double b = (T - sqrt(T * T - 4.0 * T)) / 2.0;
    printf("Y %.10f %.10f\n", a, b);
  }
}
