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