#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long double d;
    cin >> d;
    if ((d * d) - (4 * d) >= 0) {
      long double b = (d + sqrt((d * d) - (4 * d))) / 2;
      long double a = d - b;
      cout << "Y " << fixed << setprecision(9) << max(a, b);
      cout << " " << fixed << setprecision(9) << min(a, b) << endl;
    } else {
      cout << "N" << endl;
    }
  }
  return 0;
}
