#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  int a = 6, b = 10, c = 14, d = 15;
  cin >> t;
  while (t--) {
    cin >> n;
    int x = n - 30;
    if (n <= 30)
      cout << "NO\n";
    else if (x == a)
      printf("YES\n%d %d %d %d\n", a, c, d, n - (a + c + d));
    else if (x == b)
      printf("YES\n%d %d %d %d\n", a, c, d, n - (a + c + d));
    else if (x == c)
      printf("YES\n%d %d %d %d\n", a, c, d, n - (a + c + d));
    else
      printf("YES\n%d %d %d %d\n", b, c, a, n - (b + c + a));
  }
  return 0;
}
