capegemini - find the speed of boat in still water if it takes 5 hours to cover a certain distance upstream and takes just 2 and half hours to cover the same distance downstream the rate of stream is 10 kmph - skillgun

If the speed downstream is a km/hr and the speed upstream is b km/hr, then:
Speed in still water = (a + b)/2 km/hr.
Rate of stream = (a - b)/2 km/hr.
Let boat's upstream speed be x km/hr and downstream be y km/hr
Distance covered in upstream for 5 hours = Distance covered in downstream for 2 1/2 or 5/2 hours.
By using distance = speed x time, we get
x * 5 = y * 5/2
2(5x) = 5y
2x = y
y - 2x = 0
Given that, the speed of stream is 10 km/hr
i.e., (y-x)/2 = 10
y - x = 20 ...eqn 2
Solving the above eqn, we get
x = 20 and y = 40
Speed of Boat in still water = (x + y)/2
(20 + 40)/2 = 30.