#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O2")
const int LIM = 5e5 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tests;
  cin >> tests;
  cout << setprecision(10) << fixed;
  while (tests--) {
    long double d;
    cin >> d;
    long long v = d * d - 4 * d;
    if (v < -1e-9) {
      cout << "N\n";
    } else {
      long double a, b, c;
      c = sqrt(v);
      a = (d + c) / 2;
      b = (d - c) / 2;
      cout << "Y " << a << " " << b << "\n";
    }
  }
  return 0;
}
