# Task
 Round the given number `n` to the nearest multiple of `m`.

 If `n` is exactly in the middle of 2 multiples of m, return `n` instead.

# Example

 For `n = 20, m = 3`, the output should be `21`.

 For `n = 19, m = 3`, the output should be `18`.

 For `n = 50, m = 100`, the output should be `50`.

# Input/Output


 - `[input]` integer `n`

 `1 ≤ n < 10^9.`


 - `[input]` integer `m`

 `3 ≤ m < 109`.


 - `[output]` an integer

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def rounding(n, m):
	

Solutions:
def rounding(n, m):
	return n if n % m == m / 2 else m * round(n / m)


def rounding(n, m):
	(down, up) = (n // m * m, n // m * m + m)
	if up - n < n - down:
		return up
	elif up - n == n - down:
		return n
	return down


def rounding(n, m):
	return n if n / m % 1 == 0.5 else round(n / m) * m


def rounding(n, m):
	diff = n % m
	if diff < m / 2:
		return n - diff
	elif diff > m / 2:
		return n - diff + m
	return n


def rounding(n, m):
	(q, r) = divmod(n, m)
	return q * m if 2 * r < m else (q + 1) * m if 2 * r > m else n


from math import gcd, ceil

def rounding(n, m):
	return round(n / m) * m if n != (n // m * m + ceil(n / m) * m) / 2 else n


from math import ceil, floor

def rounding(n, m):
	(a, b) = (m * ceil(n / m), m * floor(n / m))
	(da, db) = (abs(n - a), abs(n - b))
	if da == db:
		return n
	if da < db:
		return a
	return b


import math

def rounding(n, m):
	a = n - math.floor(n / m) * m
	b = math.ceil(n / m) * m - n
	return n if a == b else math.floor(n / m) * m if a < b else math.ceil(n / m) * m


def rounding(n, m):
	floored = n // m * m
	diff = n - floored
	return floored if 2 * diff < m else floored + m if 2 * diff > m else n