#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    double d;
    cin >> d;
    if (d >= 1 && d <= 3)
      cout << "N\n";
    else {
      double a, b;
      b = (d + sqrt(d * d - 4 * d)) / 2;
      a = d - b;
      cout << "Y " << setprecision(10) << b << " " << a << "\n";
    }
  }
  return cout << "\n", 0;
}
