#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MAXN = 100000;
int t, d;
double a, b;
int main() {
  cin >> t;
  for (int _t = 0; _t < t; ++_t) {
    cin >> d;
    double D = d * d - 4 * d;
    if (D < 0.00) {
      printf("N\n");
    } else {
      D = sqrt(D);
      printf("Y %.10lf %.10lf\n", (d - D) / 2, (d + D) / 2);
    }
  }
  return 0;
}
