AtCoder Beginner Contest 102 - Multiple of 2 and N

You are given a positive integer N.
Find the minimum positive integer divisible by both 2 and N.

-----Constraints-----
 - 1 \leq N \leq 10^9
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N

-----Output-----
Print the minimum positive integer divisible by both 2 and N.

-----Sample Input-----
3

-----Sample Output-----
6

6 is divisible by both 2 and 3.
Also, there is no positive integer less than 6 that is divisible by both 2 and 3.
Thus, the answer is 6.

Source: atcoder | Difficulty: EASY


Solutions:
n = int(input())
if n % 2 == 0:
	print(n)
else:
	print(n * 2)


x = int(input())
print(x * ((x % 2 != 0) + 1))


N = int(input())
if N % 2 == 0:
	ans = N
else:
	ans = 2 * N
print(ans)


N = int(input())
a = N if N % 2 == 0 else 2 * N
print(a)


N = int(input())
if N % 2:
	print(2 * N)
	quit()
print(N)


i = int(input())
print(i if i % 2 == 0 else i * 2)


import math
N = int(input())
print(N * 2 // math.gcd(2, N))


import math
n = int(input())
a = math.gcd(n, 2)
print(n * 2 // a)


N = int(input())
if N % 2 == 1:
	N = 2 * N
print(N)


N = int(input())
if N % 2:
	o = N * 2
else:
	o = N
print(o)


a = int(input())
print(a + a % 2 * a)


n = int(input())
ans = n
if n % 2:
	ans = ans * 2
print(ans)


n = int(input())
print(n * 2 if n % 2 == 1 else n)


import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def main():
	N = int(readline())
	if N % 2 == 0:
		print(N)
	else:
		print(2 * N)
	return

def __starting_point():
	main()
__starting_point()


a = int(input())
print(a * (a % 2 + 1))


n = int(input())
print(n * (1 + (n % 2 != 0)))


x = int(input())
if x % 2:
	print(2 * x)
else:
	print(x)


print((lambda x: x * (x % 2 + 1))(int(input())))


import math
n = int(input())
gcd = math.gcd(2, n)
lcm = int(2 * n / gcd)
ans = lcm
print(ans)


a = int(input())
if a % 2:
	print(a * 2)
else:
	print(a)


N = int(input().rstrip())
if N & 1 == 1:
	print(N * 2)
else:
	print(N)


n = int(input())
print((n, 2 * n)[n % 2])


import math
N = int(input())

def lcm(a, b):
	return int(a * b // math.gcd(a, b))
print(lcm(2, N))


N = int(input())
print(N + N * (N % 2))


n = int(input())
print(n if not n % 2 else n * 2)


R = int(input())
if R % 2 == 0:
	print(R)
else:
	print(R * 2)


num = int(input())
if num % 2 == 0:
	print(num)
else:
	print(num * 2)


a = int(input())
print([a * 2, a][a % 2 == 0])


a = 0
N = int(input())
if N % 2 == 1:
	a = 2 * N
if N % 2 == 0:
	a = N
print(a)


N = int(input().strip())
print(N if N % 2 == 0 else N * 2)


A = int(input())
if A % 2:
	print(2 * A)
else:
	print(A)


n = int(input())
print(n * -~(n & 1))


N = int(input())
from fractions import gcd
print(2 * N // gcd(2, N))


from math import gcd
n = int(input())
print(2 * n // gcd(n, 2))


N = int(input())
if N % 2 != 0:
	N *= 2
print(N)


s = int(input())
if s % 2 == 0:
	print(s)
else:
	print(2 * s)


def main():
	n = int(input())
	print(n if n % 2 == 0 else 2 * n)
main()


from numpy import lcm
n = int(input())
print(lcm(2, n))


a = int(input())
b = 2
import math
print(int(a * b / math.gcd(a, b)))


x = int(input())
res = x * 2
if x % 2 == 0:
	res = x
print(res)


import math

def lcm(x, y):
	return x * y // math.gcd(x, y)
n = int(input())
print(lcm(2, n))


N = int(input())
print(N if N % 2 == 0 and N / N else int(N) * 2)


print((lambda x: x if x % 2 == 0 else x * 2)(int(input())))


import sys
s = int(input())
if s % 2 == 1:
	s = 2 * s
print(s)


N = int(input())
print([2 * N, N][N % 2 == 0 and N >= 2])


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '3'
		output = '6'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '10'
		output = '10'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '999999999'
		output = '1999999998'
		self.assertIO(input, output)

def resolve():
	N = int(input())
	if N % 2 == 0:
		print(N)
	else:
		print(N * 2)

def __starting_point():
	resolve()
__starting_point()


k = int(input())
if k % 2 == 0:
	print(k)
else:
	print(2 * k)


_ = int(input())
print(_ << (_ & 1))


A = int(input())
if A % 2 == 1:
	A *= 2
print(A)


N = int(input())
for i in range(2, 10 ** 6):
	if N % 2 == 0:
		break
	N *= i
print(N)


def get_input() -> int:
	N = int(input())
	return N

def main(N: int) -> None:
	ans = N
	if ans % 2 != 0:
		ans *= 2
	print(ans)

def __starting_point():
	N = get_input()
	main(N)
__starting_point()


S = int(input())
if S % 2 == 0:
	print(S)
else:
	print(2 * S)


N = int(input())
ans = (1 + N % 2) * N
print(ans)


n = int(input())
if n % 2 == 0:
	print(n)
elif n % 2 != 0:
	print(2 * n)


import math
n = int(input())
print([n, 2 * n][n % 2 > 0])


t = int(input())
if t % 2 == 0:
	print(t)
else:
	print(t * 2)


N = int(input())
print(N % 2 * N * 2 or N)


import sys
import math
import numpy as np
import itertools
n = int(input())
if n % 2 == 0:
	print(n)
else:
	print(n * 2)


num = int(input())
print(num * 2 if num % 2 == 1 else num)


N = int(input())
print(N << 1 if N & 1 else N)


import sys
import math
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inm = lambda : map(int, sys.stdin.readline().split())
inl = lambda : list(inm())
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))
N = ini()
if N % 2 == 0:
	print(N)
else:
	print(N * 2)


N = int(input())
if N % 2 == 1 and N != 0:
	N *= 2
print(str(N))