#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  double t, d, a, b, x;
  cin >> t;
  while (t--) {
    cin >> d;
    x = (d * d - 4 * d);
    if (x < 0.0)
      cout << "N\n";
    else {
      x = sqrt(x);
      a = (d + x) / 2.0;
      b = (d - x) / 2.0;
      cout << "Y " << fixed << setprecision(9) << a << " ";
      cout << fixed << setprecision(9) << b << "\n";
    }
  }
  return 0;
}
