#include <bits/stdc++.h>
using namespace std;
using Long = long long;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int d;
    cin >> d;
    if (d * d < 4 * d) {
      puts("N");
    } else {
      double dis = sqrt(d * d - 4 * d);
      double x = (dis + d) / 2, y = (d - dis) / 2;
      printf("Y %0.10lf %0.10lf\n", x, y);
    }
  }
  return 0;
}
