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