#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int d;
    double a, b;
    cin >> d;
    double dys = sqrt(d * d - 4 * d);
    b = (d - dys) / (2);
    a = d - b;
    if (a >= 0 && b >= 0) {
      cout << "Y ";
      printf("%.9f %.9f", a, b);
      cout << endl;
      continue;
    }
    b = (d + dys) / (2);
    a = d - b;
    if (a >= 0 && b >= 0) {
      cout << "Y ";
      printf("%.9f %.9f", a, b);
      cout << endl;
      continue;
    }
    cout << "N" << endl;
  }
}
