#include <bits/stdc++.h>
using namespace std;
using pl = pair<long long, long long>;
using vll = vector<long long>;
using mll = map<long long, long long>;
using vpl = vector<pl>;
long long mod = 10000009;
void solve() {
  double d, a, b;
  cin >> d;
  if (d * d - 4 * d >= 0) {
    a = (d + sqrt(d * d - 4 * d)) / 2;
    b = d - a;
    printf("Y %0.9lf %0.9lf\n", a, b);
  } else {
    printf("N\n");
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
