Problem 440 -- Eeny Meeny Moo
Tips
It is a rather easy problem. Make an array and fill them up by zero. Then fill them up one by one with numbers 1, 2, 3....assuming that m = 1. When the array is full, check whether item 2 is N. If not, increase m by one and repeat the above procedure, until you get item 2 = N. Return m as the answer.
Input
3 4 149 0
Output
2 5 65