#include <bits/stdc++.h>
using namespace std;
const long long MAX = 1e6;
const long long mod = 1e9 + 7;
const long long inf = 1e18 + 12;
long long arr[MAX];
map<long long, long long> mm;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cout.tie(NULL);
  ;
  long long tt;
  cin >> tt;
  while (tt--) {
    long long d, l = 0, i;
    cin >> d;
    long long k = d * d - 4 * d;
    if (k >= 0) {
      double a = (d + sqrt(k)) / 2;
      cout << "Y " << setprecision(10) << a << " " << d - a << "\n";
    } else
      cout << "N\n";
  }
  return 0;
}
