#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3fll;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int d;
    scanf("%d", &d);
    if (d < 4 and d) {
      printf("N\n");
      continue;
    }
    printf("Y ");
    double a = d + sqrt(d * d - 4 * d);
    a /= 2;
    double b = d - a;
    printf("%.12lf %.12lf\n", a, b);
  }
  return 0;
}
