#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long q;
  cin >> q;
  while (q--) {
    double d;
    cin >> d;
    if (d * d < 4 * d) {
      cout << "N"
           << "\n";
    } else {
      cout << "Y " << fixed << setprecision(9) << (d + sqrt(d * (d - 4))) / 2
           << " " << (d - sqrt(d * (d - 4))) / 2 << "\n";
    }
  }
}
