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: Runtime Error

Solution code:
def actual(N, a_list):
    diff_max = 0

    for i in a_list:
        for j in a_list:
            diff = i - j

            if diff < 0:
                diff = -1 * diff

            if diff > diff_max:
                diff_max = diff

    return diff_max

N = int(input())
a_list = map(int, input().split())
 
print(actual(N, a_list))

Submission status: Runtime Error

Solution code:
def actual(N, a_list):
    diff_max = 0

    for i in a_list:
        for j in a_list:
            diff = i - j

            if diff < 0:
                diff = -1 * diff

            if diff > diff_max:
                diff_max = diff

    return diff_max

N = int(input())
a_list = map(int, input().split())
 
print(actual(N, a_list))

Submission status: Runtime Error

Solution code:
N = int(input())
list = list(map(int, input().split()))
Max = max(list)
Min = min(list)
print(Max - Min)

Submission status: Runtime Error

Solution code:
from math import gcd

n=int(input())

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

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
list_ai = list(map(int,input().split()))
a1 = np.array(list_ai)-np.arange(1,N+1)
median1 = int(np.floor(np.median(a1)))
ans = np.sum(np.abs(a1-median1))
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def gcd(n, m):
    # 最大公約数
    a = max(n,m)
    b = min(n,m)
    while b:
        a, b = b, a % b
    return a

n = input()
print(2*n/gcd(2,n))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import itertools
import funtools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
A.sort()
dif = A[N-1]-A[0]
print(dif)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())

##2つの整数a,bに対し，最大公約数g,最小公倍数lとおくと，
##ab=gl

g = math.gcd(2,N)
l = 2*N/g

print(int(l))

Submission status: Runtime Error

Solution code:
import bisect
n=int(input())
A=list(map(int,input().split()))
S=[A[0]]
for i in range(n-1):
  S.append(S[-1]+A[i+1])
ans=10**15
for i in range(2,n-1):
  A1=A[0:i]
  A2=A[i:n]
  if len(A1)==2:
    M1=max(A1)
    m1=min(A1)
  else:
    x=bisect.bisect_left(S,S[i-1]//2,lo=0,hi=i+1)
    M11=max(S[x-1],S[i-1]-S[x-1])
    m11=min(S[x-1],S[i-1]-S[x-1])
    M12=max(S[x],S[i-1]-S[x])
    m12=min(S[x],S[i-1]-S[x])
    M1=min(M11,M12)
    m1=max(m11,m12)
  S2=[A[i]]
  for i in range(i+1,n):
    S2.append(S2[-1]+A[i])
  if len(A2)==2:
    M2=max(A2)
    m2=min(A2)
  else:
    x=bisect.bisect_left(S2,S2[-1]//2,lo=0,hi=len(S2))
    M21=max(S2[x-1],S2[-1]-S2[x-1])
    m21=min(S2[x-1],S2[-1]-S2[x-1])
    M22=max(S2[x],S2[-1]-S2[x])
    m22=min(S2[x],S2[-1]-S2[x])
    M2=min(M21,M22)
    m2=max(m21,m22)
  a=max(M1,M2)-min(m1,m2)
  if a<ans:
    ans=a
print(ans)

Submission status: Runtime Error

Solution code:
if N/2%=0
  print(N)
else
  print(2N)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

a = [int(i)-j for i,j in zip(input().split(),range(n))]

l = -10 ** 10

r = 10 ** 10

def f(x):
  return sum(map(lambda y: abs(y - x), a))

while r - l > 3:
  l_r = (r - l) // 3
  l_i = l + l_r
  i_r = r - l_r
  if f(l_i) > f(i_r):
    l = l_i
  else:
    r = i_r
print(min(f(l),f(l+1),f(l+2),f(l+3)))

Submission status: Runtime Error

Solution code:
N = int(input())
l = [int(x) for x in input().split()]
m = []
for i in l:
  for j in l:
    ans = abs(i - j)
    m.append(ans)
    
print(max(m))

Submission status: Runtime Error

Solution code:
input()
a = list(map(int,input().split()))
min = pow(10,9)
max =  1
for i in a:
    if i<min:
        min = i
    if i>max:
        max = i
print(max-min)

Submission status: Runtime Error

Solution code:
input()
a = list(map(int,input().split()))
max = a[0]
min = a[0]
for i in a:
    if i>max:
        max = i
    if i<min:
        min = i
print(max-min)

Submission status: Runtime Error

Solution code:
input()
l = sorted(list(map(int,input().split())))
print(l[-1]-l[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from fractions import gcd
print(int(2 * n / gcd(2, n)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
line = input()
num = [int(n) for n in line.split()]

smaller_divisible_number = num
if num%2 != 0:
    smaller_divisible_number *= 2
print(smaller_divisible_number)

Submission status: Runtime Error

Solution code:
line = input()
X = [int(n) for n in line.split()]

smaller_divisible_number = X
if num%2 != 0:
    smaller_divisible_number *= 2
print(smaller_divisible_number)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import gcd
n = int(input())
def lcm2(x):
    return x * 2 // gcd(x, 2)
print(lcm2(n))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))

lis = []
for i in range(len(A)):
  for j in range(len(A)):
    lis.append(abs(A[i]-A[j]))

print(max(lis))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))

lis = []
for i in range(len(A)):
  for j in range(len(A)):
    lis.append(abs(A[i]-A[j]))

print(max(lis))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(n):
    a[i] -= (i+1)

a.sort()
for i in range(n):
    s += abs(a[i]-a[n//2])

print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def resolve():
    N=int(input())
    A=list(map(int,input().split()))

    for i in range(N):
        A[i]=A[i]-i-1

    minval = 10 ** 10
    j=0
    temp = 10**10
    while True:
        val=0
        for i in A:
            val+=abs(i-j)
        if val>=temp:
            break
        else:
            temp=val
            minval=min(minval,val)
            j+=1

    minval = 10 ** 10
    j=1
    temp = 10**10
    while True:
        val=0
        for i in A:
            val+=abs(i+j)
        if val>=temp:
            break
        else:
            temp=val
            minval=min(minval,val)
            j+=1
    print(minval)
resolve()

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
import math

a = int(input())

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

Submission status: Runtime Error

Solution code:
import math

a = list(map(int, input().split()))
a.append(2)
ans = a[0]
N = len(a)
for i in range(1, N):
    ans = ans * a[i] // math.gcd(ans, a[i])
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
li = list(map(int, input().split()))
ans = 0
for i in li:
    for j in li:
        ztc = abs(i - j)
        if ztc > ans:
            ans = ztc
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = input()

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

Submission status: Runtime Error

Solution code:
n = input()
A = list(map(int, input().split()))
print(int(max(A)) - int(min(A)))

Submission status: Runtime Error

Solution code:
N = input()
A = list(map(int, input().split()))
print(int(max(A)) - int(min(A)))

Submission status: Runtime Error

Solution code:
n = input()
A = list(map(int, input().split()))
print(int(max(A))-int(min(A)))

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
a = list(map(int, input().split()))

a_d = []
for i in range(1, n+1):
    a_d.append(a[i-1]-i)

d = (list(np.absolute(a_d)))
d.sort()
m = d[int(n/2)]

print(abs(sum(d-m)))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))

a_d = []
for i in range(1, n+1):
    a_d.append(a[i-1]-i)

d = (list(np.absolute(a_d)))
d.sort()
m = d[int(n/2)]

print(abs(sum(d-m)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
o=input()
a=list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Runtime Error

Solution code:
input()
a=list(map(int,input().split()))
print(max(a)-min(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

a = [int(i) for i in input().split()]

i=0

max = 0
min = 0
for i in range(n):
  if a[i] >= max:
    max = a[i]
  elif a[i] <= min:
    min = a[i]
  else
    continue
    
print (max - min)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ソースコード
from fractions import gcd
n=int(input())
g=gcd(2,n)
print(2*n//g)

Submission status: Runtime Error

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

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

print(lcm(2, N))

Submission status: Runtime Error

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

if N % 2 == 0 :
    print(N)
else :
    print((2 * N) // math.gcd(2, N))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
A = list(map(int, input().split()))
top = 0
bottom = 10 ** 9
for a in A:
    if a > top:
        top = a
    if a < bottom:
        bottom = a
print(abs(top - bottom))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input)

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n = int(input())
li = list(map(int,input().split()))
li.sort()
print(abs(li[-1]-li[0]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,a=input(),sorted(list(map(int,input().split())))
print(a[N-1]-a[0])

Submission status: Runtime Error

Solution code:
import math

def main():
    n = int(input())
    print(int(2*n/math.gcd(2, n)))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

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

Submission status: Runtime Error

Solution code:
import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき


N=int(input())

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

Submission status: Runtime Error

Solution code:
import math
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

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

N=int(input())

print(lcm(2,N))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))

d = 0
c = []
for b in range(0,max(a)+1):
    for i in range(0,len(a)):
        d += abs(a[i]-(b+i+1))
    c.append(d)
    d = 0
print(min(c))

Submission status: Runtime Error

Solution code:
N = int(input())

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

print(lcm(2, N))

Submission status: Runtime Error

Solution code:
a = int(input())
ans = 0
if a % 2 == 0:
    ans = a
elif a[i] == "-":
    ans = a * 2

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
import sys
def lcm(a, b):
    return a*b // math.gcd(a, b)

input = sys.stdin.readline
N = int(input())
print(lcm(2, N))

Submission status: Runtime Error

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

import sys
input = sys.stdin.readline
N = int(input())
print(lcm(2, N))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
ll = map(int,input().split())
 
print(max(ll)-min(ll))

Submission status: Runtime Error

Solution code:
from itertools import combinations

N = int(input())
A = [int(num) for num in input().split()]

combs = combinations(A, 2)

ret = 0
for comb in combs:
    if abs(comb[0] - comb[1]) > ret:
        ret = abs(comb[0] - 1)

print(ret)

Submission status: Runtime Error

Solution code:
a = int(input())
b = [int(i) for i in input().split()]

max_num = max(b)
min_num = min(b)

print(max_num - min_num)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
a = 2


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

print(lcm(a, n))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
A.sort()
print(abs(A[0]-A[-1]))

Submission status: Runtime Error

Solution code:
a = [input() for i in range(2)]
b = a[1]
x = int(max(b))-int(min(b))
print(x)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
x = int(max(b))-int(min(b))
print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

count = int(input())
num = input().split()
a = []
for i in num:
    a.append(int(i))

a = sorted(a)

print(a[count - 1] - a[0])

Submission status: Runtime Error

Solution code:
import math

n = int(input())

print(2*n//math.gcd(2,n)) #最小公倍数

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

def lcm(x, N):
  return (x * N) // math.gcd(x, N)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def lcm(2, N):
  return (2 * N) // math.gcd(2, N)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
A_ = [a-i-1 for i,a in enumerate(A)]
print (A_)
A_.sort()
print (A_)
b = A_[N//2]
print (b)
print(sum([abs(ai-b) for ai in A_]))

Submission status: Runtime Error

Solution code:
C:\Users\Reaz\PycharmProjects\untitled\venv\Scripts\python.exe C:/Users/Reaz/Downloads/fuck.py
6
6 5 4 3 2 1
[5, 3, 1, -1, -3, -5]
[-5, -3, -1, 1, 3, 5]
1
18

Process finished with exit code 0

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = sorted(map(int,input().split()))
print(a[n-1]-a[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,*A=map(int,open(0).read().split())
A = sorted(A)
print(A[-1]-A[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

def fact(n):
  if 1<n:
    return n + fact(n-1)
  else:
    return n


N = int(input())
A = list(map(int,input().split()))
b = int(round(float((sum(A)-fact(N)))/N))
if b<0:
    b -= 1

ans = 0

for i in range(N):
    ans += abs(A[i]-(b+i+1))

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split())
ans = -1
for i in range(N):
    for j in range(i, N):
        s = abs(A[i] - A[j])
        ans = max(ans, s)

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split())
ans = -100
for i in range(N):
	for j in range(i, N):
		s = abs(A[i] - A[j])
        ans = max(ans, s)
print(ans)

Submission status: Runtime Error

Solution code:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

# inputa = [int(n) for n in inputa]
# inputa.sort()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

ans(a*2)

Submission status: Runtime Error

Solution code:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

inputa = [int(n) for n in inputa]
inputa.sort()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

ans(a*2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

val = []

for i in range(n):
    val.append(a[i]-i)

val.sort()
#print(val)

#idx = [(val[0],0)]
idx = []
cnt = 1
for i in range(n-1):
    if val[i] == val[i+1]:
        #cnt += 1
        if i == n-2:
            idx.append((val[i],i+2))
        continue
    else:
        idx.append((val[i],i+1))
        #cnt = 1
        
ans_val = 0

for i in range(len(idx)):
    if idx[i][1] >= (n) // 2:
        ans_val = idx[i-1][0]

#print(ans_val)
#exit()
     
ans = 0
ans2 = 0
ans3 = 0
for i in range(n):
    ans += abs(a[i]-ans_val-i)
    ans2 += abs(a[i]-ans_val-i+1)
    ans3 += abs(a[i]-ans_val-i-1)
    

print(min(ans,ans2,ans3))

Submission status: Runtime Error

Solution code:
from itertools import accumulate

N = int(input())
A = list(map(int,input().split()))
A = list(accumulate(A))
ans = []

for i in range(N-3):
    for j in range(i+1, N-2):
        for k in range(j+1, N-1):
            list = []
            p = A[i]
            q = A[j]-A[i]
            r = A[k]-A[j]
            s = A[-1]-A[k]
            list = [p, q, r, s]
            ans.append(max(list) - min(list))

print(min(ans))

Submission status: Runtime Error

Solution code:
# coding:utf-8
import fractions
def main():
    n = int(input())
    ans = 2*n / fractions.gcd(2,n)
    print(int(ans))

    if __name__ == '__main__' :
    main()

Submission status: Runtime Error

Solution code:
# coding:utf-8
import math
def main():
    n = int(input())
    ans = 2*n / math.gcd(2,n)
    print(int(ans))



if __name__ == '__main__' :
    main()

Submission status: Runtime Error

Solution code:
# coding:utf-8
#ab=gl
import math
def main():
    n = int(input())
    ans = 2*n / math.gcd(2,n)
    print(int(ans))



if __name__ == '__main__' :
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
B = [it - (idx + 1) for idx, it in enumerate(A)]
S = []

for b in B:
    C = [abs(i-b) for i in B]
    s = sum(C)
    S.append(s)
    
print(min(S))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n=int(input())

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

Submission status: Runtime Error

Solution code:
def INT(): return int(input())
def LIST(): return list(map(int, input().split()))
 
INF = float('inf')
 
 
def sad(A, b):
    s = 0
 
    for i, a in enumerate(A):
        s += abs(a - (b + i))
 
    return s
 
 
def main():
    N = INT()
    A = LIST()
    MA = max(A)
    m = INF
 
    for i in range(N):
        s = sad(A, MA-i)
        if s < m:
            m = s
 
    print(m)
 
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def INT(): return int(input())

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n,*l=map(int,open(0).read().split())
a=sum(l[i]-i-1for i in range(n))//n
f=lambda x:sum(abs(l[i]-i-1-x)for i in range(n))
print(min(f(a-1),f(a),f(a+1)))

Submission status: Runtime Error

Solution code:
from math import gcd

line = input()
n = int(line)
ret = 2 * n // gcd(2, n)
print(ret)

Submission status: Runtime Error

Solution code:

import math
n = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
a = int(input())
items = input().split(" ")
nums = []
for i in range(a):
  nums.append(int(items[i]))
max_num = max(nums)
min_num = min(nums)
print(max_num - min_num)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

print(max(A)-min(A))

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

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


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


print(lcm(2, N))

Submission status: Runtime Error

Solution code:
import math

n=int(input())

#最小公倍数を定義
def lcm(x,y):
    return (x*y)//math.gcd(x,y)

print(lcm(n,2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def gcd(a, b):
  if b > a:
    a, b = b, a
    while b != 0:
      a, b = b, a % b
    return a

n = int(input())
ans = n * 2 // gcd(n, 2)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]

for k in range(N):
    A[k] -= k

A.sort()


def get_pity_sum(x):
    pity_sum = 0
    for l in A:
        if A[x] - l >= 0:
            pity_sum += A[x] - l
        else:
            pity_sum += l - A[x]
    return pity_sum


if N % 2 == 1:
    print(min(get_pity_sum(int((N - 1) / 2)), get_pity_sum(int((N - 1) / 2 - 1)), get_pity_sum(int((N - 1) / 2 + 1))))
else:
    print(min(get_pity_sum(int(N / 2)), get_pity_sum(int(N / 2 - 1))))

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()] 

print(max(a) - min(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

if(n%2 == 0):
  print(n)
else:
  t=1
  while 1:
    t+=1
    n=n＊t
    if(n%2==0):
      print(n)
      break

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math 

n = int(input())

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

Submission status: Runtime Error

Solution code:
from math import gcd

n = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(){
	int N;
	scanf("%d", &N);
	if (N % 2)
		printf("%d", N*2);
	else
		printf("%d", N);
	
	return 0;
}

Submission status: Runtime Error

Solution code:
x = int(input('数字を入力してください: '))

if  x % 2 == 0 : # 最初の条件、かつ、二つ目の条件
     print(k)
else:
     print(2*k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n = int(input())

# for i in range(1, 10**9):
#     if i % 2 == 0 and i % n == 0:
#         print(i)
#         break

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

Submission status: Runtime Error

Solution code:
N = int(input())
A_list = list(map(int, input().split()))

A_max = max(A_list)
A_min = min(A_list)
print(A_max - A_min)

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(input())
A=list(map(int,input().split()))
B=[A[i]-i-1 for i in range(N)]
B.sort()
if N%2==0:
    b=B[N//2]
else:
    b=(B[N//2-1]+B[N//2])//2
print(int(sum([abs(Bb-b) for Bb in B])))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())


print(int((b-a)*(b-a+1)/2-b))

Submission status: Runtime Error

Solution code:
#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    if (n%2==0){
        cout<< n << endl;
    }else{
        cout << 2*n <<endl;
    }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = input().split()
l.sort()
print(abs(int(l[0]) - int(l[-1])))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(lcm(2, N))