#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    double n, a;
    cin >> n;
    if (n > 0.0 && n < 4.0)
      cout << "N\n";
    else {
      a = n;
      cout << "Y ";
      double x, y;
      x = (a + sqrt(a * a - 4 * a)) / 2;
      y = (a - sqrt(a * a - 4 * a)) / 2;
      cout << fixed << setprecision(9) << x << " " << y << "\n";
    }
  }
  return 0;
}
