#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
long long maxi(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long mini(long long a, long long b) {
  if (a > b) return b;
  return a;
}
long long f(long long n, long long a, long long b) {
  if (a > b) swap(a, b);
  double ans = 1;
  while (a > 0) {
    ans *= (double)(n / a);
    n--;
    a--;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n == 0) {
      cout << "Y 0.0000000000 0.0000000000"
           << "\n";
      continue;
    }
    if (n > 0 && n < 4) {
      cout << "N"
           << "\n";
      continue;
    }
    double D = n * n - 4 * n, a, b;
    D = sqrt(D);
    a = n + D;
    b = n - D;
    cout << "Y " << a / 2 << " " << b / 2 << "\n";
  }
  return 0;
}
