spoj amr11a

i am trying to solve http://www.spoj.com/problems/AMR11A/
but i am getting a wrong answer please give me a test case where my solution fails…
http://ideone.com/6QuouA

//