#include <bits/stdc++.h>
using namespace std;
const long long N = 2 * 1e8 + 1, M = 1e5, OO = 0x3f3f3f3f;
int main() {
  int t;
  cin >> t;
  cout << fixed << setprecision(9);
  while (t--) {
    int d;
    cin >> d;
    double a = (d + sqrt(d * d - 4 * d)) / 2.0;
    double b = (d - sqrt(d * d - 4 * d)) / 2.0;
    if ((int)(a + b) == d) {
      cout << "Y" << endl;
      cout << a << " " << b << endl;
    } else
      cout << "N" << endl;
  }
  return 0;
}
