assuming A and B are on the same side....
THe walking man will take....2/4 hrs..=30min.
the man with the boat..for going...1/(4+2)hrs=10min.
the man with the boat...for returning...1/(4-2)hrs..30min
total...=40min.
but please clear the line.."row a .boat at velocity of 4km/hr relative to the water"