How to constrain 2 dynamic arrays to related to each other?

In reply to dave_59:

Dave, thanks for your reply.
I have updated the code and comments after the variable declaration and constraints.

  1. the number of names in c_typ_e and e_typ_e fixed at 2 and 4 respectively
  2. arr_sz mostly is 8n, also could be 2n (such as 2,4,6), if 2*n, C requires to evenly distributed, E not required.