#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100007;
const double eps = 1e-6;
int main() {
  int n;
  double d;
  cin >> n;
  while (n--) {
    cin >> d;
    double der = sqrt(d * d - 4 * d);
    if (der < 0) {
      cout << "N" << endl;
      continue;
    }
    double cc = (-d - der) / (-2), dd = (-d + der) / (-2);
    if (abs(((d - cc) * cc) - d) < eps)
      printf("Y %.9lf %.9lf\n", cc, d - cc);
    else if (abs(((d - dd) * dd) - d) < eps)
      printf("Y %.9lf %.9lf\n", dd, d - dd);
    else
      cout << "N" << endl;
  }
  return 0;
}
