#include <bits/stdc++.h>
using namespace std;
void solve() {
  double d;
  cin >> d;
  if (d == 1 || d == 2 || d == 3) {
    cout << "N" << '\n';
  } else {
    cout << "Y"
         << " ";
    if (((d + sqrt((d * d) - 4 * d)) / 2) == 0) {
      cout << 0 << " " << 0 << '\n';
    } else {
      cout << fixed << setprecision(9) << (d + sqrt((d * d) - 4 * d)) / 2 << " "
           << d / ((d + sqrt((d * d) - 4 * d)) / 2) << '\n';
    }
  }
}
int32_t main() {
  long long int t = 1;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  while (t--) {
    solve();
  }
}
