#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.precision(10);
  long long int t;
  cin >> t;
  while (t--) {
    double d;
    cin >> d;
    if (d < 4 && d > 0)
      cout << "N"
           << "\n";
    else {
      cout << "Y ";
      double a = (d + sqrt(d * d - 4 * d)) / 2;
      double b = d - a;
      cout << a << " " << b << "\n";
    }
  }
  return 0;
}
