#include <bits/stdc++.h>
using namespace std;
int t, n;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    if (n <= 30) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    if (n == 36) {
      printf("5 6 10 15\n");
      continue;
    }
    if (n == 40) {
      printf("6 9 10 15\n");
      continue;
    }
    if (n == 44) {
      printf("6 7 10 21\n");
      continue;
    }
    printf("6 10 14 %d\n", n - 30);
  }
  return 0;
}
