#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  unsigned long long d, n;
  cin >> n;
  while (n-- > 0) {
    cin >> d;
    if (d * d < 4 * d) {
      cout << "N" << endl;
    } else {
      double t = (double)d;
      double ans = (t + sqrt(t * t - 4 * t)) / 2;
      printf("Y %.9f %.9f\n", ans, ans / (ans - 1));
    }
  }
}
