#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.precision(15);
  cout.setf(ios::floatfield, ios::fixed);
  long t;
  cin >> t;
  while (t--) {
    double a1, a2, b1, b2, c, r, d;
    cin >> d;
    r = d * d - 4 * d;
    if (r < 0) {
      cout << "N" << endl;
      continue;
    }
    a1 = (d + sqrt(r)) / 2;
    b1 = d - a1;
    if (a1 >= 0 && b1 >= 0) {
      cout << "Y"
           << " " << a1 << " " << b1 << endl;
      continue;
    }
    a2 = (d - sqrt(r)) / 2;
    b2 = d - a2;
    if (a2 >= 0 && b2 >= 0) {
      cout << "Y"
           << " " << a2 << " " << b2 << endl;
      continue;
    }
    cout << "N" << endl;
  }
}
