#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long d;
    cin >> d;
    double p = sqrt((d * d * 1.0) - (4 * d * 1.0));
    double q = (d - p) / (2.0);
    double r = (p + d) / (2.0);
    if (d == 1 || d == 2 || d == 3)
      cout << "N" << endl;
    else {
      cout << "Y ";
      cout << setprecision(12) << q << " " << setprecision(12) << r << endl;
    }
  }
  return 0;
}
