#include <bits/stdc++.h>
using namespace std;
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
  uniform_int_distribution<int> uid(0, lim - 1);
  return uid(rang);
}
int i, j;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    double l = 0;
    double r = n;
    for (i = 0; i < 100; i++) {
      double m = (l + r) / 2;
      double mm = n - m;
      if (m * mm < n) {
        r = m;
      } else {
        l = m;
      }
    }
    if (n == 0) {
      cout << "Y"
           << " " << 0.0000000000 << " " << 0.0000000000 << "\n";
    } else if (l == 0) {
      cout << "N"
           << "\n";
    } else {
      cout << "Y"
           << " " << setprecision(20) << l << " " << setprecision(20) << n - l
           << "\n";
    }
  }
}
