#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  int n;
  while (t--) {
    cin >> n;
    if (n <= 30) {
      cout << "NO" << '\n';
    } else {
      int temp = n - (6 + 10 + 14);
      cout << "YES" << '\n';
      if (temp == 6 || temp == 10 || temp == 14) {
        cout << 6 << " " << 10 << " " << 15 << " " << (temp - 1) << '\n';
      } else {
        cout << 6 << " " << 10 << " " << 14 << " " << temp << '\n';
      }
    }
  }
}
