#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  long double d;
  cin >> d;
  if (d * d - 4 * d < 0.0) {
    cout << "N\n";
  } else {
    cout << "Y ";
    cout << fixed << setprecision(9);
    cout << (d - sqrt(d * d - 4 * d)) * 0.5L << " ";
    cout << (d + sqrt(d * d - 4 * d)) * 0.5L << "\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int _;
  cin >> _;
  while (_--) {
    solve();
  }
  return 0;
}
