Get posts base on category ratio of more then two categories

It appears to me to be fairly easy. You just reference https://codex.wordpress.org/The_Loop

You could create two loops, the first to identify how many posts there are in Category A, Category B, and Category C.

Then you take from category A 20% of the total number of posts (converted to an integer), then from category B a total of 50% of the total number of posts minus those to A (again integer conversion) and the remainder go to category C.

Once you know how many to take from each, then you can run the loop again.

There are probably more elegant ways to do this, but I suspect this just gets the job done and gets you on to other issues more quickly.

Please let me know if you need more detail. (WP_query might be another approach from https://developer.wordpress.org/reference/classes/wp_query/ )