using namespace std;
your code snippet should look like this
You should store t-p or p-t instead of si-ti or ti-si. Read the sample test case properly and you will understand why you should do that.
tried with the abs thing…still getting wrong answer
i am not asking you to try abs @sharan669v , i wanted to say smthing else,
look i have stored t-p in max ,what you were doing is storing ti-si