#include <bits/stdc++.h>
using namespace std;
void solve() {
  double n;
  cin >> n;
  if (n == 1)
    cout << "N\n";
  else if (n == 0)
    cout << "Y 0 0\n";
  else {
    double x = -(2 - n);
    if ((n * n) - (4 * n) < 0)
      cout << "N\n";
    else {
      double dispo = sqrt(((n * n) - (4 * n)));
      double root1 = x - dispo, root2 = x + dispo;
      root1 /= 2.0;
      double f = 1 + root1;
      cout << "Y " << (f) << " " << n - (f) << "\n";
    }
  }
}
int main() {
  cout << fixed << setprecision(13);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
