#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
using namespace std;
map<int, int>::iterator it;
int str[MAXN];
int main() {
  int T;
  double m, n;
  cin >> T;
  while (T--) {
    cin >> m;
    int flag = 0;
    if (int(m * m - 4 * m) < 0)
      printf("N\n");
    else {
      double a, b;
      a = (m + sqrt(m * m - 4 * m)) / 2;
      b = (m - sqrt(m * m - 4 * m)) / 2;
      printf("Y %.9lf %.9lf\n", a, b);
    }
  }
}
