#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    if (n == 0) {
      cout << "Y"
           << " " << 0 << " " << 0 << "\n";
      continue;
    }
    if (n * n < 4 * n)
      cout << "N"
           << "\n";
    else {
      double a = (n * 1.0 + sqrt(n * n - 4 * n)) / 2.0;
      double b = n / a;
      cout << "Y"
           << " " << fixed << setprecision(9) << a << " " << b << "\n";
    }
  }
}
