#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n, i;
    cin >> n;
    if (n * n < 4 * n) {
      cout << "N" << '\n';
    } else {
      cout << "Y ";
      double d = sqrt(n * n - 4 * n);
      double a, b;
      b = (n + d) / 2;
      a = (n - d) / 2;
      cout << fixed << setprecision(9) << a << " " << fixed << setprecision(9)
           << b << '\n';
    }
  }
  return 0;
}
