#include <bits/stdc++.h>
using namespace std;
struct abc {
  long long int c, x, y;
};
bool compare(abc a1, abc a2) {
  if (a1.x == a2.x) return a1.y > a2.y;
  return a1.x < a2.x;
}
const long long int mod = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long double d;
    cin >> d;
    if (d * d - 4 * d < 0)
      cout << "N\n";
    else {
      long double x = (d + sqrt(d * d - 4 * d)) / 2,
                  y = (d - sqrt(d * d - 4 * d)) / 2;
      cout << "Y " << fixed << setprecision(10) << x << ' ' << y << endl;
    }
  }
}
