#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int d;
    cin >> d;
    long double a, b;
    if (d != 0 && d < 4) {
      printf("N\n");
    } else {
      long double e = d;
      if (d == 0) {
        a = 0;
        b = 0;
      } else if (d == 4) {
        a = 2;
        b = 2;
      } else {
        long double delta = 1;
        a = 1;
        b = d - 1;
        for (int i = 0; i < 50; i++) {
          while (a * b < d) {
            a += delta;
            b -= delta;
          }
          a -= delta;
          b += delta;
          delta /= 2;
        }
      }
      printf("Y %0.9Lf %0.9Lf\n", a, b);
    }
  }
  return 0;
}
