#include <bits/stdc++.h>
using namespace std;
void err() {
  cout << "NO\n";
  exit(0);
}
int main() {
  int t, i;
  double d;
  cin >> t;
  while (t--) {
    cin >> d;
    if (d == 0) {
      double z = 0;
      cout << "Y ";
      cout << fixed << setprecision(9) << z << ' ' << z << endl;
      continue;
    }
    if (d < 4) {
      cout << "N\n";
    } else {
      double a, b, D;
      D = sqrt(d * d - 4 * d);
      a = (D + d) / 2;
      b = (d - D) / 2;
      cout << "Y ";
      cout << fixed << setprecision(9) << a << ' ' << b << endl;
    }
  }
  return 0;
}
