#include <bits/stdc++.h>
using namespace std;
const long INF = 1000 * 1000 * 1000;
const long long int mod = 1000000007;
int dp[100050];
int main() {
  std::ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    long double d;
    cin >> d;
    long double a, b, x, y;
    x = d * d - 4 * d;
    if (x < 0) {
      cout << "N" << '\n';
      continue;
    }
    x = sqrt(x);
    if (d - x < 0) {
      cout << "N" << '\n';
      continue;
    }
    a = (d + x) / 2.0;
    b = (d - x) / 2.0;
    cout << "Y"
         << " ";
    cout << setprecision(12) << fixed << a << " ";
    cout << setprecision(12) << fixed << b << " ";
    cout << '\n';
  }
}
