8 Km at 80 Km/hr takes 1/10 hours;
x Km at 100 Km/hr takes x/100 hours;
y km at 60 km/hr takes y/60 hours;
in one direction the sum of these is 2 hours, so 1/10 + x/100 + y/60 = 2. In the other direction , however, whatever was uphill becomes downhill and whatever was downhill becomes uphill; so the roles of x and y changes and we get the equation
1/10 + x/60 +y/100 =3. These equations can be simplified to get
6x + 10y = 1140
6y + 10x = 1740
the solution is x=165 km, and y = 15 km. so the total distance is 165 + 15 + 8 = 188 km.