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