#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int t;
int n;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    int tmp = n * n - 4 * n;
    if (tmp < 0)
      printf("N\n");
    else {
      printf("Y %.9lf %.9lf\n", (n + sqrt(tmp)) / 2, (n - sqrt(tmp)) / 2);
    }
  }
  return 0;
}
