Answers to: SIMBABY - Editorialhttps://discuss.codechef.com/questions/142123/simbaby-editorial<h1>PROBLEM LINK:</h1>
<p><a href="https://www.codechef.com/BULE2018">Contest</a></p>
<p><strong>Author:</strong> <a href="https://www.codechef.com/users/shivank01">Shivank Pathak</a></p>
<p><strong>Editorialist:</strong> <a href="https://www.codechef.com/users/shivank01">Shivank Pathak</a></p>
<h1>DIFFICULTY:</h1>
<p>EASY</p>
<h1>PREREQUISITES:</h1>
<p>Math</p>
<h1>PROBLEM:</h1>
<p>The problem is to calculate the optimal scores and check if the two persons have similar scores.</p>
<h1>EXPLANATION:</h1>
<p>The order of covering the points is already defined, the problem just reduces to figuring out the way to calculate the scores between 2 points (A, B) and (C, D).</p>
<p>Note that what only matters is X = abs(A-C) and Y = abs(B-D).</p>
<p>While X and Y are positive, you will move along the diagonal and X and Y would both reduce by 1.
When one of them becomes 0, you would move so that in each step the remaining number reduces by 1.</p>
<p>In other words, the total number of steps would correspond to max(X, Y).</p>
<p>Then we have to sort the scores of both and then compare it.</p>
<h1>AUTHOR'S AND TESTER'S SOLUTIONS:</h1>
<p>Author's solution can be found <a href="www.codechef.com/download/Solutions/#">here</a>. </p>enFri, 22 Mar 2019 01:59:53 -0000