As you can see for the 17th Hadju there are 5 ways to achieve the maximum Fire power of 24. These are the lines with number 12 – 19 – 20 – 22 and 23.
Further you can see for the 18th dragoon that there are even 7 ways of achieving the maximum of 92. These are the lines with number 2 – 3 – 4 – 5 – 6 -17 and 18.
For the 18th musket and grenadier there are 7 ways aswell to achieve the maximum of 22. These are the lines with the number 1 – 6 – 7 – 8 - 10 – 12 and 24.
You already can tell now that you will never be able to have your 17th muskets fully upgraded at the same time as your 18th dragoons.
If you look at the 18th muskets and 18th dragons there only seems to be 1 line that enables you to have maximum fire in both units, being 22 and 92. This is line 6.
Ok, whats the logical choice then? To pick this line and forget about the -1 for the 17th musket. You could play with pikes aswell.
This example goes from the idea that you would make either 17th muskets + 18th muskets + 18th dragons. In this case the combination 30/15/20/10 is the best(line6).
But what if you play with hussars instead of 18th dragons and you make 17th muskets. Then you could look for an combination that gives you the maximum on the 17th muskets. Now let’s look for a combination that gives the maximum for 17th muskets and 18th muskets. This appears to be (line 12 with) this combination: 20/15/30/10
Further notice that for the unique unit of Hungary there are only 2 combinations that yield you the maximum of 58 being line 8 and 12.
Suppose you play a 17th century game with 17th muskets and 17th dragons. The perfect line would be 12 aswell.