#include <bits/stdc++.h>
using namespace std;
void yolosmile() {
  int test;
  cin >> test;
  double d;
  cout << fixed << setprecision(9);
  while (test--) {
    cin >> d;
    double delta = d * d - d * 4;
    double x1 = (d + sqrt(delta)) / 2.0;
    double x2 = (d - sqrt(delta)) / 2.0;
    double y1 = d - x1;
    double y2 = d - x2;
    if (y1 + x1 == d && x1 >= 0 && y1 >= 0)
      cout << "Y " << x1 << ' ' << y1 << '\n';
    else if (y2 + x2 == d && x2 >= 0 && y2 >= 0)
      cout << "Y " << x2 << ' ' << y2 << '\n';
    else
      cout << "N\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  yolosmile();
  return 0;
}
