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