There are 6 people and you need that only if 4 combines all the locks will be opened
ie if you take any 3 people there will be 1 lock which needs to be opened and the key to that is available only with any of the other 3 people
Hence for any 3 people you need to distribute one lock among the other 3 peopl
This requires a total of 6C3 distinct locks wie 20 distinct locks
Hence the safe should be locked with 20 locks and te key distribution for each of the general would be
General 1 :K1, K2, K3, K4, K5, K6, K7, K8, K9, K10,
General 2 :K1, K2, K3, K4, K11, K12, K13, K14, K15, K16,
General 3 :K1, K5, K6, K7, K11, K12, K13, K17, K18, K19,
General 4 :K2, K5, K8, K9, K11, K14, K15, K17, K18, K20,
General 5 :K3, K6, K8, K10, K12, K14, K16, K17, K19, K20,
General 6 :K4, K7, K9, K10, K13, K15, K16, K18, K19, K20,