#include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long, long long> &a, pair<long long, long long> &b) {
  if (a.second < b.second)
    return 1;
  else
    return 0;
}
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    double d;
    cin >> d;
    if (d > 0 && d < 4) {
      cout << "N"
           << "\n";
      continue;
    }
    cout << "Y"
         << " " << fixed << setprecision(10) << (d + sqrt(d * d - 4 * d)) / 2
         << " " << (d - sqrt(d * d - 4 * d)) / 2 << "\n";
  }
  return 0;
}
