#include <bits/stdc++.h>
using namespace std;
long long int p[200008] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  long long int n, z, x, i;
  long double p, q;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    z = x * x - 4 * x;
    if (z < 0) {
      cout << "N\n";
      continue;
    }
    cout << "Y ";
    p = (long double)(x + sqrt(z)) / 2;
    q = (long double)(x - sqrt(z)) / 2;
    cout << setprecision(20) << p << " " << setprecision(20) << q << endl;
  }
}
