#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n >= 1 && n <= 3) {
      cout << "N" << endl;
    } else {
      cout << "Y"
           << " ";
      double d1 = n + sqrt(n * (n - 4));
      d1 = d1 * 1.0 / 2;
      double d2 = n - sqrt(n * (n - 4));
      d2 = d2 * 1.0 / 2;
      cout << fixed << setprecision(9) << d1 << " ";
      cout << fixed << setprecision(9) << d2 << endl;
    }
  }
  return 0;
}
