#include <bits/stdc++.h>
using namespace std;
double i, j, k, l, m, n, d, t, a[1009];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  for (int i = 1; i <= t; i++) {
    cin >> d;
    if (d * d - 4 * d < 0) {
      printf("N\n");
      continue;
    }
    l = (d + sqrt(d * d - 4 * d)) / 2;
    printf("Y %0.9lf %0.9lf\n", l, d - l);
  }
}
