#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n == 1) return false;
  if (n == 2) return true;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long pw(long long a, long long b, long long p) {
  if (b == 0) return 1;
  long long t = pw(a, b / 2, p);
  if (b % 2)
    return (((a * t) % p) * t) % p;
  else
    return ((t * t) % p);
}
long long fact_pow(long long n, long long k) {
  long long res = 0;
  while (n) {
    n /= k;
    res += n;
  }
  return res;
}
long long GCD(long long a, long long b) {
  if (!b) return a;
  return GCD(b, a % b);
}
long long LCM(long long a, long long b) { return (a * b) / GCD(a, b); }
long long binarySearch(long long arr[], long long l, long long r, long long x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return 1;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
void swap(long long *a, long long *b) {
  long long temp = *a;
  *a = *b;
  *b = temp;
}
void solve() {
  long long d;
  cin >> d;
  long long diff = d * (d - 4);
  if (diff < 0) {
    cout << 'N' << endl;
  } else {
    auto difference = sqrt(diff);
    auto a = (d + difference) / 2;
    auto b = d - a;
    cout << fixed << setprecision(9);
    cout << 'Y' << " " << a << " " << b << endl;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
