Unable to submit 'Rise and fall of Power' problem

Hi Team,

I have written solution/program for Rise and Fall of Power problem in PHP langauge…

I am excepting inputs using STDIN (standard input stream) as per required by codechef…

I have tested this on my local maching from command line…which is giving me desired output also…

but when I submit my code in code chef it gives me “wrong answer”

can anybody help me with this?

Thanks in advance…