#include <bits/stdc++.h>
using namespace std;
template <class T, class T2>
inline int chkmax(T &x, const T2 &y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class T2>
inline int chkmin(T &x, const T2 &y) {
  return x > y ? x = y, 1 : 0;
}
const int MAXN = (1 << 20);
double a;
void read() { cin >> a; }
void solve() {
  double D = a * a - 4 * a;
  if (D < 0) {
    cout << "N" << '\n';
    return;
  }
  D = sqrt(D);
  double x = (-a + D) / (-2.0);
  cout << setprecision(9) << fixed << "Y " << x << " " << a - x << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    read();
    solve();
  }
  return 0;
}
