total time alloted is 1 hour
\n" );
document.write( "
\n" );
document.write( "speed of the current=4 kmph
\n" );
document.write( "speed of the boat=12 kmph
\n" );
document.write( "
\n" );
document.write( "Upstream:
\n" );
document.write( "let the distance be x
\n" );
document.write( "speed=12-4 (since the boat and current will be in opposite directions)
\n" );
document.write( "=8 kmph
\n" );
document.write( "time=distance/speed=(x/8)hour
\n" );
document.write( "
\n" );
document.write( "Downstream:
\n" );
document.write( "the distance will be equal to the distance it goes upstream
\n" );
document.write( "so distance=x
\n" );
document.write( "speed=12+4 (since boat and current will both be in the same direction)
\n" );
document.write( "=16 kmph
\n" );
document.write( "time=distance/speed=(x/16)hour
\n" );
document.write( "
\n" );
document.write( "total time=(time upstream)+(time downstream)
\n" );
document.write( "1=(x/8)+(x/16)
\n" );
document.write( "1=(2x+x)/16
\n" );
document.write( "1=3x/16
\n" );
document.write( "16=3x
\n" );
document.write( "x=16/3 km
\n" );
document.write( "
\n" );
document.write( "so he should go (16/3)km before turning around
\n" );
document.write( "
\n" );
document.write( "Hope this helps,
\n" );
document.write( "Prabhat
\n" );
document.write( "