#include <bits/stdc++.h>
using namespace std;
void solve() {
  double d;
  scanf(" %lf", &d);
  if (d > 0 && d < 4.0) {
    printf("N\n");
    return;
  }
  double low = 0, hi = d, mid;
  while (true) {
    mid = (low + hi) / 2;
    if (abs((mid * (d - mid)) - d) <= 1e-9) {
      printf("Y %.9lf %.9lf\n", mid, d - mid);
      return;
    }
    if ((mid * (d - mid)) > d) {
      hi = mid;
    } else
      low = mid;
  }
}
int main() {
  int tc;
  cin >> tc;
  for (int i = 0; i < tc; i++) {
    solve();
  }
}
