#include <bits/stdc++.h>
using namespace std;
const int infint = 1e9;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e5 + 7;
long long T;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> T;
  for (int i = 0; i < T; i++) {
    long double d;
    cin >> d;
    long double a = -1, b = d, c = -d;
    long double delta = b * b - 4 * a * c;
    if (delta < 0) {
      cout << "N\n";
      continue;
    }
    long double A1 = (-b + sqrt(delta)) / (2 * a);
    long double A2 = (-b - sqrt(delta)) / (2 * a);
    cout << "Y ";
    cout << fixed << setprecision(9) << A1 << " " << A2 << "\n";
  }
}
