#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int d;
    cin >> d;
    cout << fixed << setprecision(10);
    if (d == 0) {
      cout << "Y"
           << " " << 0.0 << " " << 0.0 << '\n';
      continue;
    }
    if (d < 4) {
      cout << "N" << '\n';
      continue;
    }
    long long D = (d * d) - 4 * d;
    double a = (d + sqrt(D)) / 2;
    double b = (d - sqrt(D)) / 2;
    cout << "Y"
         << " " << b << " " << a << '\n';
  }
}
