#include <bits/stdc++.h>
using namespace std;
void solve(int d) {
  cout << fixed << setprecision(9);
  if (d == 0) {
    cout << "Y " << 0.0 << " " << 0.0;
  } else if (d >= 1 && d < 4)
    cout << "N";
  else {
    double D = sqrt(d * (d - 4));
    double a = (d + D) / 2.0;
    double b = (d - D) / 2.0;
    cout << "Y " << a << " " << b;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int d;
    cin >> d;
    solve(d);
    cout << endl;
  }
  return 0;
}
