#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-16;
int main() {
  std::ios_base::sync_with_stdio(0);
  int cases;
  long double d;
  cin >> cases;
  while (cases--) {
    cin >> d;
    long double low = 0.0, high = d * 0.5, mid, x, y;
    for (int i = 1; i <= 100; i++) {
      mid = (low + high) * 0.5;
      x = mid, y = d - mid;
      if (x * y < d || abs(x * y - d) < EPS)
        low = mid;
      else
        high = mid;
    }
    x = mid, y = d - mid;
    if (abs(x * y - d) < 0.0000001)
      cout << fixed << setprecision(12) << "Y " << x << " " << y << '\n';
    else
      cout << "N" << '\n';
  }
  return 0;
}
