#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846;
void rw() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    long double a, b, c, t = 2;
    long long n;
    cin >> n;
    if (n > 3) {
      c = sqrt(n * n - 4 * n);
      a = (n - c) / t;
      b = (n + c) / t;
      cout << "Y " << setprecision(9) << fixed << b << " " << a;
      goto done;
    } else if (!n) {
      cout << "Y 0 0";
      goto done;
    }
    cout << "N";
  done:;
    cout << "\n";
  }
  return 0;
}
