A pastry cook is preparing special dishes for her daughter's birthday. It takes her a minutes to prepare the first dish, and each following dish takes b minutes longer than the previous dish. There are a total of t minutes available to prepare the dishes.
For example, if the first dish takes a = 10 minutes and b = 5, then the second dish will take 15 minutes, the third dish will take 20 minutes, and so on.
If we have 80 minutes to prepare the dishes, then we can prepare four dishes because 10 + 15 + 20 + 25 = 70.
Write a program that prompts the user to enter the values of a, b, and t, and outputs the number of dishes that can be prepared in the allocated time t and the amount of time remaining (see Sample Run below).
Sample Run
Enter the number of minutes to prepare first dish: 6
Enter how many more minutes to prepare the next dish: 4
Enter the total time (in minutes) to prepare all the dishes: 57
In 57 minute(s) the pastry cook can prepare 4 dishes with 9 minutes unused.