Your question is very ambiguous. You give "training times" in seconds but then say "you have a limited space of 2.43 billion units". What are these units of space? Do you means seconds? And you say "you can train 3 different armies at the time". Do you mean you can train three at the same time, without taking time from the others? You say "before running out of capacity". What is "capacity"? Is that the "units" you talk about?

It would appear that you get 4/2= 2 "power" for each second of training with type 1, 8/10= 4/5 "power" for each second of training with type 2, and 16/24= 2/3 "power" for each second of training with type 3. With the information you give, I would say, first train as many units of type 1, which returns the highest "power" per second that you can. Then, with the units left, train as many units of type 2 that you can, training any left over units as type 1.

Since there are no "continuous functions" involved here, I see no way of using Calculus.