Rectangles Doubt

Problem Link: Rectangles

I was thinking won’t the correct output by virtue of symmetry for both the following test cases be same:

1
1 1

1
99999 1

Basically, in the first case, you can strip off the rectangle with diagonally opposite coordinates as (0,0) and (1,500) and find the area of the rest of the rectangle which can be computed as 50000000 - 500 = 49999500

Similarly, in the second case, you can strip off the rectangle with diagonally opposite coordinates as (99999,0) and (100000,500) and find the area of the rest of the rectangle which will be the same. As you are again deducting 500 units of area.

Is this reasoning correct?

For some reason, when i view the problem, all i see is a bunch of Math computing error :slightly_smiling_face: :thinking:

1 Like

I honestly did try but really cannot figure out my mistake (or the encrypted message you wished to convey). :see_no_evil: Can you please elaborate a bit more? :see_no_evil: Thank you.