#include <bits/stdc++.h>
using namespace std;
int main() {
  long t;
  cin >> t;
  while (t--) {
    double d;
    cin >> d;
    if (d * d >= 4 * d) {
      cout << "Y " << setprecision(12)
           << (double)((d + sqrt(d * d - 4 * d)) / 2) << " " << setprecision(12)
           << (double)((d - sqrt(d * d - 4 * d)) / 2) << endl;
    } else {
      cout << "N " << endl;
    }
  }
  return 0;
}
