#include <bits/stdc++.h>
using namespace std;
string s, s1;
double n, m, a, b, i, j, d, t, t1, cs = 0, counT = 0, k, ans = 0, l = 0,
                                   temp = 0, sum = 0, Max, Min, num;
long long int arr[10000000];
vector<long long int> vc;
map<long long int, long long int> mp;
int main() {
  cin >> n;
  while (n--) {
    cin >> d;
    temp = d * d - 4 * d;
    if (temp < 0) {
      cout << "N" << '\n';
      continue;
    }
    t = .5 * (d + sqrt((d * d - ((4 * d)))));
    t1 = .5 * (d - sqrt((d * d - ((4 * d)))));
    Min = min(t, t1);
    cout << "Y"
         << " " << fixed << setprecision(9) << d - Min << " " << fixed
         << setprecision(9) << Min << '\n';
  }
}
