#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long d;
    cin >> d;
    long double dis = (d * d - 4 * d);
    if (dis < 0)
      cout << "N\n";
    else {
      dis = sqrt(dis);
      long double a = (d + dis) / 2;
      long double b = (d - dis) / 2;
      cout << setprecision(15) << fixed;
      if (a >= 0 && b >= 0) {
        cout << "Y " << a << " " << b << '\n';
      } else
        cout << "N\n";
    }
  }
  return 0;
}
