#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, d;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &d);
    double a = 0, b = 0;
    double x = d * d - 4 * d;
    if (x < 0) {
      printf("N\n");
      continue;
    } else {
      a = (d - sqrt(x)) / 2.0;
      b = d - a;
      if (a < b) swap(a, b);
      printf("Y %.9lf %.9lf\n", a, b);
    }
  }
  return 0;
}
