Chingel is practicing for a rowing competition to be held on this saturday. He is trying his best to win this tournament for which he needs to figure out how much time it takes to cover a certain distance. 

**Input**

You will be provided with the total distance of the journey, speed of the boat and whether he is going downstream or upstream. The speed of the stream and direction of rowing will be given as a string. Check example test cases!

**Output**

The output returned should be the time taken to cover the distance. If the result has decimal places, round them to 2 fixed positions.

`Show some love ;) Rank and Upvote!`

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def time(distance, boat_speed, stream):
	

Solutions:
def time(distance, boat_speed, stream):
	return round(distance / (boat_speed + int(stream.split()[-1])), 2) if stream[0] == 'D' else round(distance / (boat_speed - int(stream.split()[-1])), 2)


def time(d, v, s):
	return round(d / (v + int(s.split()[1]) * (1 if s[0] == 'D' else -1)), 2)


def time(d, v, s):
	return round(d / (v + int(s.split()[1]) * ('D' in s or -1)), 2)


def time(distance, boat_speed, stream):
	speed = boat_speed + (int(stream[11:]) if stream[0] == 'D' else -int(stream[9:]))
	return round(distance / speed, 2)


def time(distance, boat_speed, stream):
	(direction, speed_str) = stream.split()
	speed = int(speed_str) * (1 if direction == 'Downstream' else -1)
	return round(distance / (boat_speed + speed), 2)


from operator import truediv

def time(distance, boat_speed, stream):
	(stream, stream_speed) = stream.split()
	stream_speed = int(stream_speed) * (-1 if stream == 'Upstream' else 1)
	return round(truediv(distance, boat_speed + stream_speed), 2)


def time(distance, boat_speed, stream):
	s = stream.split()
	net_speed = boat_speed + int(s[1]) if s[0] == 'Downstream' else boat_speed - int(s[1])
	return round(distance / net_speed, 2)


def time(distance, boat_speed, stream):
	(direction, stream_speed) = tuple(stream.split())
	stream_speed = int(stream_speed)
	if direction == 'Downstream':
		if distance % (boat_speed + stream_speed) == 0:
			return int(distance / (boat_speed + stream_speed))
		else:
			return float('%.2f' % (distance / (boat_speed + stream_speed)))
	elif distance % (boat_speed - stream_speed) == 0:
		return int(distance / (boat_speed - stream_speed))
	else:
		return float('%.2f' % (distance / (boat_speed - stream_speed)))


time = lambda d, s, S: round(d / (s + (-1) ** (S[0] > 'D') * int(S.split()[1])), 2)