#include <bits/stdc++.h>
using namespace std;
std::vector<int> vi;
int t;
double d;
int main(int argc, char const *argv[]) {
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> d;
    if (d > 0 && d < 4) {
      cout << "N" << endl;
      continue;
    }
    double delta = (d - 4) * d;
    printf("Y %.9lf %.9lf\n", ((d + sqrt(delta)) / 2), ((d - sqrt(delta)) / 2));
  }
  return 0;
}
