#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    6;
    cin >> n;
    if (n > 30 && n != 36 && n != 40 && n != 44) {
      cout << "YES" << endl;
      cout << 6 << " " << 10 << " " << 14 << " " << n - 30 << endl;
    } else if (n > 31) {
      cout << "YES" << endl;
      cout << 6 << " " << 10 << " " << 15 << " " << n - 31 << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
