Hey <sundarshoba>

Following is my worked solution :

<1st IF>

Let original speed be s1. s2 - speed increased by 20%.

s1 : s2

100 : 120

5 : 6

As distance from X to Y is constant (for both original speed, s1 and increased speed, s2) , the time ratio is the inverse (reverse) of the speed ratio. In other words, the faster the speed, the shorter time it will take to travel over same distance ( or to reach same destination ).

t1 : t2

6 : 5

Given that he reached Y an hour earlier, we have ...

1u --> 1 hr

Hence, under original speed, it would take 6 hours to reach Y.

<2nd IF>

From the point (after travelling 120 km at original speed) , speed (s3) was increased by 25%. We have ...

s1 : s3

100 : 125

4 : 5

As distance from this point to Y is the same , the time ratio is the inverse (reverse) of the speed ratio. So we have ...

t1 : t2

5 : 4

Given that he reached Y 40 min (2/3 hr) earlier, we have ...

1u --> (2/3)

4u --> (8/3)

As part of this journey is under original speed (s1) for 120 km, and another part under increased speed (s3), and given total time taken for whole journey is 40 min (2/3 hr) shorter compared to original speed (s1), we have ...

Total time taken for this whole journey = 6 - (2/3) = (16/3) hrs

Time taken for 1st part journey of 120 km under s1

= (16/3) - (8/3) = (8/3)

Speed s1 = 120 ÷ (8/3) = 45

Total distance (from X to Y) = 45 × 6 = **270 km**

=====

Trust this helps.

Do let me know again if this is different from your <anskey> or if there's further clarification.

Cheers

Edward