In episode 178 of the Fairy Tail anime they start the final game of the Grand Magic Games. Master Mavis has come up with one strategy out of, according to her, millions of possible outcomes. It shows them coming up with it the night before. However, they say at the beginning of the Magic Games that no one will know what the game is before they announce it, so how did they have all of the night before to come up with a plan?
Your question requires two answers. First, everyone knew that the last day would be a battle royal between all members of all teams; I don't know exactly when it was first mentioned but before it happened we saw the contestants talking about how excited they were for it a few days in advance of the episode happening. To answer the second part of your question I am going to have to say that they used SAW logic with Master Mavis. To explain in more detail in case you aren't familiar with the SAW franchise, it revolves around a character named John Kramer who is a civil engineer who is very talented at predicting human nature and sets up conditions and anticipates how people will react, from his deductions he creates elaborate plans and traps and watches as people make all the moves he predicted. Master Mavis was dubbed the "Fairy Tactician" because she was able to predict human nature giving her a very good idea of how people would react to their circumstances and then she formed her plans based on how she believed everyone would react to the battle royal and for the most part it played off; we do see, however, that she was not able to predict the 3 way battle of Erza, Kagura, and Minerva as she has a mental breakdown that she failed to predict Minerva would interfere however for the most part she predicted where the opponents would head to and when they would head to where they were going.