#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int d;
    cin >> d;
    if (d == 0)
      cout << "Y 0 0\n";
    else if (d < 4)
      cout << "N\n";
    else {
      double a = (d + sqrt((d * d) - (4 * d))) / 2;
      double b = d - a;
      printf("Y %.10lf %.10lf\n", a, b);
    }
  }
}
