#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const long long int N = 1e6;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    int d;
    cin >> d;
    double h, m;
    h = d * d - 4 * d;
    if (h < 0) {
      cout << "N";
    } else {
      m = (d + sqrt(h)) / 2;
      cout << "Y " << fixed << setprecision(9) << m << " " << fixed
           << setprecision(9) << d - m;
    }
    cout << '\n';
  }
}
