#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cout.precision(10);
  for (int i = 1; i <= n; i++) {
    double d;
    cin >> d;
    if (d == 1) {
      cout << "N\n";
      continue;
    }
    if (d == 0) {
      cout << "Y 0 0\n";
      continue;
    }
    if (d < 4) {
      cout << "N\n";
      continue;
    }
    double a = (d + sqrt(d * d - 4 * d)) / 2;
    double b = d / a;
    cout << fixed << "Y " << a << ' ' << b << '\n';
  }
}
