Getting WA



please tell me why i am getting WA while it is giving the correct output for every test case i have checked…help me i am new here…
here is the question :
here is the solution :


The Solution to the above problem is recursive. For any exchange of coins for n there are three possible coins i.e. n/2, n/3, n/4. You are just checking whether n/2, n/3, and n/4 has a sum greater than n or not. But then these three numbers n/2, n/3 and n/4 can further be formed by three other numbers and hence you need to recursively call the method to get the maximum value.