#include <bits/stdc++.h>
using namespace std;
int n, t;
void solve() {
  scanf("%d", &n);
  if (n < 31) {
    printf("NO\n");
    return;
  } else {
    if (n == 36) {
      printf("YES\n5 6 10 15\n");
      return;
    }
    if (n == 40) {
      printf("YES\n5 6 14 15\n");
      return;
    }
    if (n == 44) {
      printf("YES\n6 7 10 21\n");
      return;
    }
    printf("YES\n6 10 14 %d\n", n - 30);
  }
}
int main() {
  scanf("%d", &t);
  while (t--) {
    solve();
  }
}
