#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
void input() {
  int i, j;
  cin >> n;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int i, j, temp = 0, d;
  double a, b, dd;
  input();
  cout << fixed;
  cout.precision(9);
  while (n--) {
    cin >> d;
    if (d == 0) {
      cout << "Y 0.000000000 0.000000000\n";
      continue;
    }
    if (d < 4 && d > 0) {
      cout << "N\n";
      continue;
    }
    dd = (double)d;
    a = (dd + sqrt(dd * dd - 4 * dd)) / 2;
    b = (dd - sqrt(dd * dd - 4 * dd)) / 2;
    cout << "Y " << a << ' ' << b << '\n';
  }
}
