#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
const int inf = 1e9 + 7;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int tc = 0; tc < t; tc++) {
    int d;
    cin >> d;
    if (d == 1 || d == 2 || d == 3) {
      cout << "N" << endl;
      continue;
    }
    double lo = 0;
    double hi = d / 2;
    for (int i = 0; i < 100; i++) {
      double mid = (lo + hi) / 2;
      if (mid * (d - mid) < d) {
        lo = mid;
      } else {
        hi = mid;
      }
    }
    cout << fixed << setprecision(12) << "Y " << d - lo << " " << lo << endl;
  }
}
