#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
    int T, a;
    scanf("%d", &T);
    while (~scanf("%d", &a))
    {
        if (a == 0)
            printf("Y %.9lf %.9lf\n", 0, 0);
        else if (a == 1 || a == 2 || a == 3)
            puts("N");
        else
        {
            double d = a;
            double x = (d + sqrt(d - 4) * sqrt(d)) / 2;
            double y = (d - sqrt(d - 4) * sqrt(d)) / 2;
            printf("Y %.9lf %.9lf\n", x, y);
        }
    }
    return 0;
}