#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int t;
  scanf("%d", &t);
  while (t--) {
    int d;
    scanf("%d", &d);
    if (d * d < 4 * d)
      printf("N\n");
    else {
      double a = sqrt(1.0 * (d * d - 4 * d));
      printf("Y %.9f %.9f\n", (d + a) / 2.0, (d - a) / 2.0);
    }
  }
  return 0;
}
