#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
int main() {
  long long int n, t;
  cin >> t;
  while (t--) {
    double d;
    cin >> d;
    if (d < 4 and d) {
      cout << "N" << endl;
      continue;
    }
    cout << setprecision(10) << fixed;
    cout << "Y ";
    double x = (d + sqrt(d * d - 4 * d)) / 2.0;
    double y = (d - sqrt(d * d - 4 * d)) / 2.0;
    cout << x << ' ' << y << endl;
  }
  return 0;
}
