#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 5;
long long T, d;
string s;
int32_t main() {
  cin >> T;
  while (T--) {
    cin >> d;
    if (d > 0 && d <= 3) {
      puts("N");
      continue;
    }
    printf("Y");
    long double a1 = d / 2.0 - sqrt((long double)d * d / 4.0 - d), b1 = d - a1;
    long double a2 = d / 2.0 + sqrt((long double)d * d / 4.0 - d), b2 = d - a1;
    if (a1 >= 0 && a2 >= 0)
      printf(" %.20Lf %.20Lf\n", a1, b1);
    else
      printf(" %.20Lf %.20Lf\n", a2, b2);
  }
}
