#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcdExtended(T a, T b, T *x, T *y);
template <class T>
T modInverse(T b, T m);
template <class T>
T gcd(T a, T b);
template <class T, class S>
void init(T *arr, S n, T ele);
template <class T, class S>
void print(T *arr, S n);
template <class T>
void SieveE(int n, bool prime[]);
class Graph {
 public:
  vector<int> *arr;
  int *vertices;
  int size;
  long numOfEdges;
  Graph(int n) {
    arr = new vector<int>[n];
    vertices = new int[n];
    size = n;
    numOfEdges = 0;
  }
  void add_edge(int a, int b) {
    arr[a].push_back(b);
    arr[b].push_back(a);
    numOfEdges++;
  }
  void depthFirstSearch() {
    init(vertices, size, 0);
    for (int i = 0; i < size; i++)
      if (vertices[i] == 0) dfs(i);
  }
  void dfs(int n) {
    vertices[n] = 1;
    for (int i = 0; i < arr[n].size(); i++)
      if (vertices[arr[n][i]] == 0) dfs(arr[n][i]);
  }
  void BreadthFirstSearch(int v) {
    long dist[size];
    int parent[size];
    init(dist, size, numOfEdges + 1);
    init(vertices, size, 0);
    init(parent, size, -1);
    dist[v] = 0;
    vertices[v] = 1;
    queue<int> Q;
    Q.push(v);
    while (!Q.empty()) {
      int current = Q.front();
      Q.pop();
      for (int i = 0; i < arr[current].size(); i++) {
        int w = arr[current][i];
        if (vertices[w] == 0) {
          vertices[w] = 1;
          dist[w] = dist[current] + 1;
          parent[w] = current;
          Q.push(w);
        }
      }
    }
    print(dist, size);
    print(parent, size);
  }
  void print_adjacencyList() {
    for (int i = 0; i < size; i++) {
      cout << i << ": ";
      for (int j = 0; j < arr[i].size(); j++) cout << arr[i][j] << " ";
      cout << "\n";
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long double d;
    cin >> d;
    if (d * d >= 4 * d)
      cout << "Y ";
    else {
      cout << "N\n";
      continue;
    }
    long double a = (d + (long double)sqrt(d * d - 4 * d)) / (long double)2.0;
    long double b = (d - (long double)sqrt(d * d - 4 * d)) / (long double)2.0;
    cout << std::setprecision(15) << a << " " << std::setprecision(15) << b
         << "\n";
  }
  return 0;
}
template <class T, class S>
void init(T *arr, S n, T ele) {
  for (S i = 0; i < n; i++) arr[i] = ele;
}
template <class T, class S>
void print(T *arr, S n) {
  for (S i = 0; i < n; i++) cout << arr[i] << " ";
  cout << "\n";
}
template <class T>
T gcd(T a, T b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
template <class T>
T modInverse(T b, T m) {
  T x, y;
  T g = gcdExtended(b, m, &x, &y);
  if (g != 1) return -1;
  return (x % m + m) % m;
}
template <class T>
T gcdExtended(T a, T b, T *x, T *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  T x1, y1;
  T gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
template <class T>
void SieveE(int n, bool prime[]) {
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
