#include <bits/stdc++.h>
using namespace std;
void solve(double d) {
  double a, b, mid, first = 0, last = d;
  int cnt = 1000;
  while (first <= last and cnt--) {
    mid = (first + last) / 2.0;
    double val = d - mid;
    a = mid + val;
    b = mid * val;
    if (abs(a - b) <= 0.00000001) {
      printf("Y %.9lf %.9lf\n", val, mid);
      return;
    }
    if (a > d || b > d)
      last = mid;
    else
      first = mid;
  }
  puts("N");
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    double d;
    cin >> d;
    solve(d);
  }
  return 0;
}
