Problem:


Score : 100 points

Problem Statement

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 1

3

Sample Output 1

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.

Sample Input 2

10

Sample Output 2

10

Sample Input 3

999999999

Sample Output 3

1999999998



Sample input:
3


Sample output:
6

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = max(2, n)
while True:
    if ans%2 == ans%n == 0:
        break
    ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = n
while(1):
    if a % 2 == 0 and a % n == 0:
        print(a)
        break
    a += 1

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = 1
while(1):
    if a % 2 == 0 and a % n == 0:
        print(a)
        break
    a += 1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
for i in range(1,10**9,2):
    if i%2==0 and i%N==0:
        print(i)
        break
#AC

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
for i in range(1,10**9):
    if i%2==0 and i%N==0:
        print(i)
        break

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
i = 1
while True:
  if i % 2 == 0 and i % a == 0:
    print(i)
    break
  else:
    i += 2

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
i = 1
while True:
  if i % 2 == 0 and i % a == 0:
    print(i)
    break
  else:
    i += 1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
i = 2
while True:
    if i / N == 0:
        print(i)
        break
    i += 2

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
N1 = []

for n in range(1, (N + 1)):
    N1.append(2 * n)

for i in N1:
    if i % N == 0:
        print(i)
        break

Submission status: Time Limit Exceeded

Solution code:
# your code goes here
a=int(input())
if a%2 == 0:
	k = a
else:
	k = a + 1
while k>0:
	if k %2== 0 and k % a ==0:
		print(k)
		quit()
	k = k + 2

Submission status: Time Limit Exceeded

Solution code:
# your code goes here
a=int(input())
if a%2 == 0:
	k = a
else:
	k = a + 1
while k>0:
	if k %2== 0 and k % a ==0:
		print(k)
		quit()
	k = k + a

Submission status: Time Limit Exceeded

Solution code:
# your code goes here
a=int(input())
k = a
while k>0:
	if k %2== 0 and k % a ==0:
		print(k)
		quit()
	k = k +1

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b = 2
c = a
i = 1
j = 1

while b != c:
    if b < c:
        b = 2*i
        i += 1

    elif b > c:
        c = a*j
        j += 1

print (b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 2

while i < 10**9:
  if i % 2 == 0 and i % n == 0:
    print(i)
    break
  i = i+1

Submission status: Time Limit Exceeded

Solution code:
N = input()
N = int(N)

for i in range(1,1000000000):
    if i%2 == 0 and i%N == 0:
        number = i
        print(number)
        break

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
for i in range(1,10**9):
    if i%2==0 and i%n==0:
        print(i)
        exit()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
for i in range((2*n)+1):
    if i % 2==0 and i % n==0 and i>0:
        print(i)
        break
    else:
        continue

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
f1 = False
f2 = False
a = 1
while True:
    if(a % 2 == 0):
        f1 = True
    if(a % N == 0):
        f2 = True
    if(f1 == True and f2 == True):
        break
    elif(a > N):
        a = N * 2
    else:
        f1 = False
        f2 = False
    a += 1
print(a)

Submission status: Time Limit Exceeded

Solution code:
N = input()
for i in range(1,int(10e8)) :
    if (i % 2) == 0 :
        if (i % int(N)) == 0 :
            print(i)
            break

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

i = 2
while True:
    if i%2 == 0 and i %N == 0:
        break
    i+=1

print(i)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin

a = int(stdin.readline().rstrip())

for x in range(1,1000000001):
    if x % 2 == 0  and x % a == 0 :
        print(x)
        break;

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b = a
while b % 2 != 0 or b % a != 0:
    b += 1
print(b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 2
while True:
  if i%2==0 and i%n==0:
    print(i)
    break
  i +=1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
for i in range(N,N*2+1):
    if i%N == 0 and i%2 == 0:
        print(i)
        break

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

i=1
while(1):
    if i%2==0 and i%N==0:
        print(i)
        break
    else:
        i+=1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
for i in range(1, pow(10, 9)):
	if i % 2 == 0 and i % N == 0:
		print(i)
		break

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
for i in range(1,2*N+1):
    if((i%2==0)&(i%N==0)):
        print(i)
        break;

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num = n

while num % 2 != 0 or num % n != 0:
    num += 1

print(num)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

i = N
while True:
    if i % 2 == 0 and i % N == 0:
        print(i)
        break
    i += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

print(n if n % 2 == 0 else 2 * n)

Submission status: Accepted

Solution code:
a = int(input())

if a%2 == 0:
    print(a)
else:
    print(a*2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

#https://atcoder.jp/contests/agc008/submissions/15248942
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("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N = ini()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 正整数(1 <= N <= 10^9)
    """
    # 求解処理
    ans = N
    if ans % 2 != 0:
        ans *= 2

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N = get_input()

    # メイン処理
    main(N)

Submission status: Accepted

Solution code:
import math

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力を取得
N = int(input())

# 求解処理
ans = N
if ans % 2 != 0:
    ans *= 2

# 結果出力
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import math
N = int(input())
def lcm(a,b):
    return int(a*b//math.gcd(a,b))
print(lcm(2,N))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 2 * N // math.gcd(2, N)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
if n%2:print(2*n)
else:print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
a = math.gcd(n, 2)  # 最大公約数
print(n * 2 // a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(N)

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools


n = int(input())

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


n = int(input())
print(lcm(2, n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
print(2*n if n%2 else n)

Submission status: Accepted

Solution code:
n=int(input())
ans=n if n%2==0 else 2*n
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

print(2 * n // math.gcd(2, n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n%2:
  print(2*n)
else:
  print(int(2*(n/2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a = int(input())
print(a*2//math.gcd(a, 2))

Submission status: Accepted

Solution code:
n=int(input())
print(n*(1+n%2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = int(input())

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

Submission status: Accepted

Solution code:
import math
n = int(input())
print(2 // math.gcd(2, n) * n)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input());print([2*n,n][n%2==0])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import math

def lcm(a, b):
    return (a * b) // math.gcd(a, b)

N = int(input())
print(lcm(2, N))

Submission status: Accepted

Solution code:
from math import gcd
def solve():
  N = int(input())
  ans = N*2//gcd(2,N)
  return ans
print(solve())

Submission status: Accepted

Solution code:
N = int(input())
if N == 1:
    print(2)
    exit()
ans = N if N % 2 == 0 else 2 * N
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
if n%2==0: ans = n
else: ans = n*2
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# hello worldと表示する
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
if n%2==0:
    print(n)
else:
    print(2*n)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
if n%2 !=0:
    print(2*n)
else:
    print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
if n%2==1:
  n*=2
print(n)

Submission status: Accepted

Solution code:
n=int(input())
print(n*(n%2+1))

Submission status: Accepted

Solution code:
N = int(input())

print(N * 2) if N % 2 else print(N)

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())

N = I()
print(N if N % 2 == 0 else 2*N)

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n= int(input())

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

Submission status: Accepted

Solution code:
# abc102_a.py
# https://atcoder.jp/contests/abc102/tasks/abc102_a

# A - Multiple of 2 and N /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 正整数 Nが与えられます。 2 と Nのどちらでも割り切れる最小の正整数を求めてください。

# 制約
#     1≤N≤109
#     入力はすべて整数である。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N

# 出力
# 2と Nのどちらでも割り切れる最小の正整数を出力せよ。

# 入力例 1
# 3

# 出力例 1
# 6

# 6は 2 と 3 のどちらでも割り切れる数です。 
# また、6 未満の正整数であって、2 と 3 のどちらでも割り切れるような数はありません。 よって、答えは 6です。

# 入力例 2
# 10

# 出力例 2
# 10

# 入力例 3
# 999999999

# 出力例 3
# 1999999998


def calculation(lines):
    N = int(lines[0])
    if N % 2 == 0:
        result = N
    else:
        result = N*2
    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3']
        lines_export = [6]
    if pattern == 2:
        lines_input = ['10']
        lines_export = [10]
    if pattern == 3:
        lines_input = ['999999999']
        lines_export = [1999999998]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import math
n = int(input())
print(int(2 * n / math.gcd(2, n)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

if __name__ == '__main__':

	m = 2
	n = int(input())

	ans = n * m // math.gcd(m,n)
	print(ans)

Submission status: Accepted

Solution code:
n = int(input())
print(n * (n % 2 + 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


n = int(input())

print("{}".format(int(2*n / math.gcd(2, n))))

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
print(N+N%2*N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(raw_input())
print n << (1 if n & 1 else 0)

Submission status: Accepted

Solution code:
n = int(raw_input())
print (n<< 1) if n & 1 else n

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

if (n/2).is_integer(): print(n)
else: print(2*n)

Submission status: Accepted

Solution code:
N = int(input())

print(N if N%2 == 0 else 2*N)

Submission status: Accepted

Solution code:
n = int(input())
if n%2:
    print(n*2)
else:
    print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

print(N if N % 2 == 0 else 2 * N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
    n=int(input())
    x=2*n//math.gcd(2,n)
    print(x)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

print(N) if N%2==0 else print(N*2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
print(n if n % 2 == 0 else n + n)

Submission status: Accepted

Solution code:
N = int(input())

print(2 * N if (N % 2 != 0) else N)

Submission status: Accepted

Solution code:
import math
def main():
 a = int(input())
 print(a * 2 // math.gcd(a,2))
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print([N, N*2][N%2])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = int(input())

if a%2 == 0:
  print(a)
else:
  print(a*2)

Submission status: Accepted

Solution code:
import math

N = int(input())

print(N*2//math.gcd(2,N))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())


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

Submission status: Accepted

Solution code:
n = int(input())

a = 1
b = 0
c = 0

while True:
    c = n * a
    if c % 2 == 0:
        break
    a += 1 
    
print(c)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    i = n
    while True:
        if i % 2 == 0:
            print(i)
            exit()
        i += n



if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
print(N*(N%2+1))

Submission status: Accepted

Solution code:
import sys
N = int(input())
if not (1 <= N <= 10 ** 9):
    sys.exit()

print(N) if N % 2 == 0 else print(N * 2)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
print(n if n&1 == 0 else n*2)

Submission status: Accepted

Solution code:
n=int(input())
print(n+n%2*n)

Submission status: Accepted

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