Now, a maths formula to help you get cheapest flights