Calculating the number of formwork elements with Dynamo+Python

Hi Guys! I’m new here and am trying to get almost the same result as Leosanabriam(THANK YOU SO MUCH!) in his work down here: Select a list than complies with a specific criteria

So, my question is how to calculate the most appropriate size of formwork elements for example for the column 400x400x4500 and slab 23000x23000x200 (not the exact size but close). In order to extract this information, I’ve been using Leosanabriam’s node sequence however it looks like the output leaves much to be desired.
Attached you can find my Revit file + Dynamo + picture of the output:

Cast in Place Element Selector v6.0.dyn (188.9 KB)

Here is a link of Revit file: