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