#include <bits/stdc++.h>
using namespace std;
int main() {
  double d, a, b, tmp, t2;
  int t, i;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> d;
    tmp = (d * d) - (4.0 * d);
    if (tmp >= 0) {
      t2 = sqrt(tmp);
      tmp = t2;
      a = (tmp + d) / 2.0;
      b = (d - tmp) / 2.0;
      cout << "Y " << setprecision(15) << a << " " << b << "\n";
    } else {
      cout << "N\n";
    }
  }
  return 0;
}
