#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    double x, i, j, d, a, b;
    cin >> d;
    if (d == 0) {
      cout << "Y";
      cout << fixed << setprecision(10) << " " << 0 << " " << 0 << endl;
      continue;
    }
    if (d <= 3) {
      cout << "N" << endl;
      continue;
    } else {
      x = sqrt(d * (d - 4));
      a = (d + x) / 2.0;
      b = (d - x) / 2.0;
      cout << fixed << setprecision(10) << "Y"
           << " " << a << " " << b << endl;
    }
  }
}
