#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
pair<long long, long long> p;
map<long long, long long> mp;
set<long long> s;
long long mn = INT_MAX, mx = INT_MIN;
long long n, m, tc, i, j, tmp, sum, cn, ans, res, pos, flag;
long long a[200007];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> tc;
  while (tc--) {
    double d;
    cin >> d;
    double det = d * d - 4 * d;
    if (det < 0)
      puts("N");
    else {
      double x = (d + sqrt(det)) / 2.0;
      double y = (d - sqrt(det)) / 2.0;
      printf("Y %.9f %.9f\n", x, y);
    }
  }
  return 0;
}
