Our task is to fill Large Rectangle with given smaller ones, I encountered this problem a few years ago when I had to write a program to optimize the packing of pallets into a truck. At the time, the task was too challenging for me. The only solution I could come up with was an ugly brute-force approach, which would not have been effective anyway. As it turns out, this is an NP-hard problem, which is even described on Wikipedia:
Rectangle Packing on Wikipedia
During my studies, I learned about Genetic Algorithms (GA), which are perfectly suited for this type of problem.
Please note that this algorithm finds very good, but rarely the most optimal solutions.