#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int t;
  double d;
  cin >> t;
  while (t--) {
    cin >> d;
    if (d > 0 && d < 4)
      printf("N\n");
    else {
      double temp = sqrt(d * d - 4 * d);
      double a = (d + temp) / 2;
      double b = (d - temp) / 2;
      printf("Y %.9f %.9f\n", a, b);
    }
  }
  return 0;
}
