#include <bits/stdc++.h>
using namespace std;
const int N = 3 * 1e5 + 5;
int main() {
  int t;
  cin >> t;
  double a[1005], b[1005];
  for (int i = 1; i <= t; ++i) {
    int d;
    cin >> d;
    if (d < 4 && d > 0) {
      a[i] = -1;
      b[i] = -1;
      continue;
    }
    double discr = sqrt((d * d - 4 * d) * 1.0);
    a[i] = (d + discr) / 2;
    b[i] = (d - discr) / 2;
  }
  for (int i = 1; i <= t; ++i) {
    if (a[i] == -1)
      cout << "N\n";
    else {
      cout << "Y ";
      printf("%.9f %.9f\n", a[i], b[i]);
    }
  }
  return 0;
}
