#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define Deghish ios_base::sync_with_stdio(false);cin.tie(NULL);
double EPS=1e-10;
void solve() {
  double d;cin>>d;
    if (d > 0 && d < 4) {
        cout << "N" << endl;
        return;
    }
    double aa,bb;
    double l=0,h=d/2;
    while (h-l>EPS) {
        double mid=(l+h)/2.0;
        double a=d-mid;
        double b=mid;
		if (a+b-d==EPS) {
            aa=a,bb=b;
            break;
        }
        if (a*b<d) {
            l=mid;
        }else {
            h=mid;
        }
    }
    cout<<fixed<<setprecision(9)<<"Y "<<aa<<" "<<bb<<endl;
}
signed main() {
    Deghish
    int Tc = 1;//
    cin >> Tc;
    while (Tc--) {
        solve();
    }
    return 0;
}
