#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int INF = 1e9 + 5;
const int MOD = 1e9 + 7;
double pi = 2 * acos(0.0);
void solve() {
  int d;
  cin >> d;
  if (d == 0) {
    cout << "Y 0 0\n";
    return;
  }
  int D = d * d - (4 * d);
  if (d > 0 and d < 4) {
    cout << "N\n";
    return;
  }
  double a = ((double)d + (double)(sqrt(D))) / 2.0,
         b = ((double)d - (double)(sqrt(D))) / 2.0;
  cout << "Y ";
  cout << fixed << setprecision(20) << a << ' ' << b << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
