Pls refer to CodeChef: Practical coding for everyone and pls let me know where my code went wrong!
@furiouscoding just make abs(d-b)+abs(c-a) in the code and it will work.