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:
import fractions
N = input()
k = fractions.gcd(2, N)
print(2*N / k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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 < 1 or n > 10:
    raise ValueError

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

Submission status: Runtime Error

Solution code:
n = int(input())

if n < 1 or n > 10:
    raise ValueError

print(2 * n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections

def calc_score(key):
    return sum([abs(b - key) for b in bList])

N = int(input().strip())
aList = list(map(int, input().strip().split(" ")))

bList = [a - i - 1 for i,a in enumerate(aList)]
cList = collections.Counter(bList)

ans = 1000000

scList = cList.most_common()
for pair in scList:
    score = calc_score(pair[0])
    ans = score
    
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
A = map(int,list(raw_input().split()))
Max = 0
Min = A[0]
for i in range(N):
  if Max <=A[i]:
    Max = A[i]
  if Min >= A[i]:
    Min = A[i]
print Max-Min

Submission status: Runtime Error

Solution code:
N = input()
A = map(int,list(raw_input().split()))
AA=sorted(A,reverse=True)
print AA[0]-AA[-1]

Submission status: Runtime Error

Solution code:
N = input()
A = list(raw_input().split())
AA=sorted(A,reverse=True)
print AA[0]-AA[-1]

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
def median_low(A):
    A.sort()
    b=A
    n = len(A)
    if n%2==1:
        med =b[n//2]
    else:
        x=b[n//2-1]
        y=b[n//2]
        med=(x+y)/2
        if med!=int(med):
            med=x
        else:
            med=int(med)
    return med


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

A = [v-i-1 for i,v in enumerate(A)]
x = median_low(A)

print(sum(abs(v - x) for v in A))

Submission status: Runtime Error

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

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

if N % 2 == 0:
	med1 = A[N // 2 - 1]
	med2 = A[N //2]
	ans = min(sum([abs(a - med1) for a in A]), sum([abs(a - med2) for a in A]))

else:
	med = A[N // 2]
	ans = sum([abs(a - med) for a in A])
	
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
an = [int(i) for i in input().split()]
print(sum(an)-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:
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
n = int(input())
print(lcm_base(2,n))

Submission status: Runtime Error

Solution code:
n=int(input())
A=list(map(int,input().split()))
q=0
Z=[]
for b in range(max(A)-min(A)):
  q=0
  for j in range(n):
    q+=abs(A[j]-b-min[A]-j-1)
  Z.append(q)
print(min(Z))

Submission status: Runtime Error

Solution code:
N = int(input())

t = N //2 
intger = []

for n in range(t):
  intg = N / 2
  intger.append(intg)
  N = intg
  
intgersorted = sorted(intger)

print(intger[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def lcm(m, n):
    return int(m * n / (math.gcd(m, n)))

print(lcm(2, n))

Submission status: Runtime Error

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

def lcm(m, n):
    return int(2 * n / (math.gcd(m, n)))

print(lcm(2, n))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(1,n+1):
    b.append(a[i-1] - i)
b.sort
if n % 2 != 0:
    B = b[int((n-1)/2)]
    ans = 0
    for i in range(n):
        ans += abs(a[i]-i-1-B)
    print(ans)
else:
    big = b[int((n)/2)]
    smo = b[int(n-2/2)]
    smoB = int((big+smo)/2)
    bigB = smoB + 1
    big = smo = 0
    for i in range(n):
        big += abs(a[i]-i-1-bigB)
    for i in range(n):
        smo += abs(a[i]-i-1-smoB)
    print(min(big,smo))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
#include <fstream>
#include <cmath>

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())
A = list(map(int,input().split()))
A = sorted(A)
x = A[-1]-A[0]
print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

a=soretd(S)
print(max(a)-min(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
if N%2==1:
print(2*N)
else:
print(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: 
         print(N)
else:
         print(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:
  print(N)
else:
  print(2 ＊ N)

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:
  print(N)
else:
  print(2＊N)

Submission status: Runtime Error

Solution code:
N=int(input())
a=list (map(int,input().split()))
abs_list=[]
for b in range(-max(a),max(a)):
	c=0
	for i in range(N):
		c=abs(a[i]-(b+i+1))+c	
	abs_list.append(c)		
print(min(abs_list))

Submission status: Runtime Error

Solution code:
N=int(input())
a=list (map(int,input().split()))
abs_list=[]
for b in range(-max(a),max(a)):
	c=0
	for i in range(N):
		c=abs(a[i]-(b+i+1))+c	
	abs_list.append(c)	
print(abs_list)	
print(min(abs_list))

Submission status: Runtime Error

Solution code:
# encoding: utf-8
import math
N = int(input())
A = list(map(int, input().split()))

def binsearch(seq, l, r, tar):
    # print("##", l, r, LmR[l:r + 1], tar)
    m = l + (r - l) // 2
    if l >= r: return l
    elif seq[m] < tar: return binsearch(seq, m + 1, r, tar)
    else: return binsearch(seq, l, m, tar)

Asum = [0]
tmp = 0
for Ai in A:
    tmp += Ai
    Asum.append(tmp)

LmR = []
for SAi in Asum[:-1]:
    LmR.append(-Asum[-1] + 2 * SAi)

ans = max(A) - min(A)
for b2 in range(2, N - 1):
    # b1
    # tar = -sum(A[b2:])
    tar = -(Asum[N] - Asum[b2])
    b1 = binsearch(LmR, 1, b2 - 1, tar)
    if tar - LmR[b1 - 1] < LmR[b1] - tar: b1 = max((1, b1 - 1))
    # escape
    if math.fabs((Asum[b2] - Asum[b1]) - (Asum[b1])) >= ans: continue
    # b3
    # tar = Asum[:b2]
    tar = Asum[b2]
    b3 = binsearch(LmR, b2 + 1, N - 1, tar)
    if tar - LmR[b3 - 1] < LmR[b3] - tar: b3 = max((b2 + 1, b3 - 1))
    parts = (Asum[b1], Asum[b2] - Asum[b1], Asum[b3] - Asum[b2], Asum[-1] - Asum[b3])
    # print("#", A[:b1], A[b1:b2], A[b2:b3], A[b3:], parts)
    if max(parts) - min(parts) < ans: ans = max(parts) - min(parts)
    
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

value = []
for part in input().split():
  value.append(int(part))

print(max(value) - min(value))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
A - Multiple of 2 and N
https://beta.atcoder.jp/contests/abc102/tasks/abc102_a

"""
import sys
from sys import stdin
input = stdin.readline


from math import gcd

def main(args):
    N = int(input())
    g = gcd(N, 2)
    print(N * 2 // g)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
a=int(a)
d=a
if a<2:
    b=a
    a=2
else
    b=2
c=1
while c!=0:
    c=a%b
    a=b
    b=c
print(d*2/b)
#a=2,b=1,c=1,d=1

Submission status: Runtime Error

Solution code:
a=input()
a=int(a)
d=a
if a<2:
    b=a
    a=2
else
    b=2
while c!=0:
    c=a%b
    a=b
    b=c
print(d*2/b)

Submission status: Runtime Error

Solution code:
a=input()
a=int(a)
d=a
if a<2:
    b=a
    a=2
while c!=0:
    c=a%b
    a=b
    b=c
print(d*2/b)

Submission status: Runtime Error

Solution code:
a=input()
d=a
if a>2:
else 
    b=a
    a=2
while c!=0:
    c=a%b
    a=b
    b=c
print(d*2/b)

Submission status: Runtime Error

Solution code:
a=input()
if a>2:
else 
    b=a
    a=2
while c!=0:
    c=a%b
    a=b
    b=c
print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

big = max(A)
small = min(A)
print(abs(big - small))

Submission status: Runtime Error

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

big = max(A)
small = min(A)
print(int(big - small))

Submission status: Runtime Error

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

big = max(A)
small = min(A)
print(big - small)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

gcd = lambda a, b: gcd(b, a % b)

lcm = lambda a, b: a * b // math.gcd(a, b)

lcm(2, N)

Submission status: Runtime Error

Solution code:
N = int(input())

import math

lcm = lambda a, b: a * b // math.gcd(a, b)

print(lcm(2, N))

Submission status: Runtime Error

Solution code:
N = input()

import math

lcm = lambda a, b: a * b // math.gcd(a, b)

print(lcm(2, N))

Submission status: Runtime Error

Solution code:
N = input()

import math

lcm = lambda a, b: a * b // math.gcd(a, b)

lcm(2, N)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(int(i) for i in input().split())
a.sort(reverse = True)
print(a[0]-a[-1])

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:
def main():
  n=int(input())
  if n%2:
    n=n*2
   print(n)
 main()

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/python3

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

p = a[0]
q = a[1]
r = a[2]
s = 0
for i in range(3, n):
    s += a[i]

d1 = 0
d3 = 2
while s - r > a[d3]:
    d3 += 1
    r += a[d3]
    s -= a[d3]

ans = float('inf')
for d2 in range(1, n - 1):
    ans = min(ans, max(p, q, r, s) - min(p, q, r, s))
    q += a[d2 + 1]
    while q - p > a[d1]:
        if d1 + 1 == d2 + 1:
            break
        d1 += 1
        p += a[d1]
        q -= a[d1]
    r -= a[d2 + 1]
    if d2 + 1 == d3:
        d3 += 1
        r += a[d3]
        s -= a[d3]
    while s - r > a[d3]:
        if d3  == n - 1:
            break
        d3 += 1
        r += a[d3]
        s -= a[d3]

print(ans)

Submission status: Runtime Error

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

t = list(0 for i in range(n+1))
for i in range(1, n+1):
    t[i] = t[i-1] + a[i-1]

def sum_a(i, j):
    return t[j]-t[i]

min_dif = sum_a(0, n)

for i in range(2, n-1):
    j0 = 0
    j1 = i
    u = sum_a(0, i) // 2
    while j1 - j0 > 1:
        j = (j0+j1) // 2
        if 2*sum_a(0, j) <= u: 
            j0 = j
        else:
            j1 = j
    if abs(sum_a(0, j0)-sum_a(j0, i)) < abs(sum_a(0, j1) - sum_a(j1, i)): 
        p = sum_a(0, j0)
        q = sum_a(j0, i)
    else:
        p = sum_a(0, j1)
        q = sum_a(j1, i)

    j0 = i
    j1 = n
    u = sum_a(i, n) // 2
    while j1 - j0 > 1:
        j = (j0+j1) // 2
        if sum_a(i, j) <= u: 
            j0 = j
        else:
            j1 = j
    if abs(sum_a(i, j0)-sum_a(j0, n)) < abs(sum_a(i, j1) - sum_a(j1, n)): 
        r = sum_a(i, j0)
        s = sum_a(j0, n)
    else:
        r = sum_a(i, j1)
        s = sum_a(j1, n)

    min_dif = min(min_dif, max(p, q, r, s)-min(p, q, r, s))

print(min_dif)

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

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

sm = 0
for i in range(0, n):
    sm = sm + a[i]

min_dif = sm

p = 0
for i in range(n-3):
    p = p + a[i]
    if 4*p < sm:
        next
    q = 0
    for j in range(i+1, n-2):
        q = q + a[j]
        if 3*q < sm - p:
            next
        r = 0
        for k in range(j+1, n-1):
            r = r + a[k]
            if 2*r < sm - p - q:
                next
            s = 0
            for l in range(k+1, n):
                s = s + a[l]
            d = max([p, q, r, s])-min([p, q, r, s])
            min_dif = min([d, min_dif])

p = 0
for i in range(n-3):
    p = p + a[i]
    if 4*p <= sm - 3*min_dif or 4*p >= sm + 3*min_dif:
        next
    q = 0
    for j in range(i+1, n-2):
        q = q + a[j]
        if abs(p-q) >= min_dif or 4*q <= sm - 3*min_dif or 4*q >= sm + 3*min_dif:
            next
        r = 0
        for k in range(j+1, n-1):
            r = r + a[k]
            if abs(p-r) >= min_dif or abs(q-r) >= min_dif or 4*r <= sm - 3*min_dif or 4*r >= sm + 3*min_dif:
                next
            s = 0
            for l in range(k+1, n):
                s = s + a[l]
            d = max([p, q, r, s])-min([p, q, r, s])
            min_dif = min([d, min_dif])

print(min_dif)

Submission status: Runtime Error

Solution code:
m = int(input())
a = list( map( int, input().split() ) )
b1 = a[0]
b2 = a[0]
for i in range(m):
  if a[i] > b1:
    b1 = a[i]
  elif a[i] < b2:
    b2 = a[i]
print(b1-b2)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i - 1
A = sorted(A)
medN = N//2
x = 0
for i in range(N):
    x = x + abs(A[i] - A[medN])
print(x)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i-1
sorted(A)
halfN = int(N/2)
x = 0
for i in range(N):
    x = x + abs(A[i] - A[halfN])
print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

n=int(input())
print(2*n//int(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()) 
row = input().split()
max = row[0]
min = row[0]


for i in range(n-1):
        if(max < row[i]):
            max = row[i]

for i in range(n-1):
        if(min > row[i]):
            min = row[i]


print (int(max)-int(min))

Submission status: Runtime Error

Solution code:
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]

for j in range(n-1):
    for i in range(n-1):
        if(row[j] < row[i+1]):
            max = row[i+1]


    for i in range(n-1):
        if(min > row[n-1]):
            min = row[n-1]


print (int(max)-int(min))

Submission status: Runtime Error

Solution code:
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]


    for i in range(n-1):
        if(max < row[n-1]):
            max = row[n-1]


    for i in range(n-1):
        if(min > row[n-1]):
            min = row[n-1]


print (min)

Submission status: Runtime Error

Solution code:
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]

for i  in range(n-1):
    if(row[i] < row[i+1]):
        max = row[i+1]

for i in range(n-1):
    if(row[i] > row[i+1]):
        min = row[i+1]


print(int(max)-int(min))

Submission status: Runtime Error

Solution code:
n = int(input()) 
row = map(int, input().split())
max = row[0]
min = 0

for i in range(n-1):
    if(row[i] < row[i+1]):
        max = row[i+1]

for i in range(n-1):
    if(row[i] > row[i+1]):
        min = row[i+1]

print(max-min)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [A[i]-(i+1) for i in range(N)]

ans = float("inf")
for b in range(min(A), max(A)+1):
    loss = sum([abs(A[i] - b) for i in range(N)])
    ans = min(ans, loss)


print(ans)

Submission status: Runtime Error

Solution code:
n = int(raw_input())

if n % 2 == 0:
    return n
else:
    return 2*n

Submission status: Runtime Error

Solution code:
import math

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

print(lcm(int(input())))

Submission status: Runtime Error

Solution code:
number = int(input())
nums = list(map(int, input().split(" ")))

print(max(nums) - min(nums))

Submission status: Runtime Error

Solution code:
num = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if(N%2 == 1):
print(N*2)
else:
print(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:
n = int(input())
i = n % 2

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

Submission status: Runtime Error

Solution code:
def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(i_max,i_min)
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()

Submission status: Runtime Error

Solution code:
a=input()
b=a/2

Submission status: Runtime Error

Solution code:
a=input()
b=int(a/2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
if int(a/2)*2==a:
  print(a)
#else:
  #print(a*2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
i = input()

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

Submission status: Runtime Error

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

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

print(ans)

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())
A = input()
b = A.split(" ")
c = []
for i in range(0,N):
    c.append(abs(int(b[i])))
c.sort

print(c[-1]-c[0])

Submission status: Runtime Error

Solution code:
N = int(input())
A = input()
b = A.split(" ")
c = []
for i in range(0,N):
    c.append(abs(int(b[i])))

c.sort

print(int(c[-1])-int(c[0]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

for i in range(n, 1e9+1):
    if i % n == 0 && i % 2 == 0:
        print(i)
        break

Submission status: Runtime Error

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

a = 2 * N / math.gcd(2, N)

print(a)

Submission status: Runtime Error

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

for i in range(n):
    a[i] -= i + 1

a.sort()

if n%2 == 0:
    result = (a[n//2] + a[(n+1)//2]) / 2
else:
    result = a[n//2]
    
print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from itertools import accumulate, islice
from bisect import bisect_left
 
n = int(input())
xs = [int(x) for x in input().split()]
 
ys = list(accumulate(xs))
zs, total = ys[:-1], ys[-1]
 
res = max(xs) - min(xs)
for i, z in islice(enumerate(zs), 1, n-1):
    j = bisect_left(zs, z//2)
    splits = ((zs[j+k], z - zs[j+k]) for k in (-1, 0, 1) if 0 <= j+k <= i)
    a, b = min(splits, key=lambda s:abs(s[0]-s[1]))
 
    j = bisect_left(zs, (total - z)//2 + z)
    splits = ((zs[j+k] - z, total - zs[j+k]) for k in (-1, 0, 1) if i <= j+k <= n-2)
    c, d = min(splits, key=lambda s:abs(s[0]-s[1]))
 
    minn, _, _, maxx = sorted((a,b,c,d))
    if maxx - minn < res:
        res = maxx - minn
 
print(res)

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 numpy as np
#import pdb

N = int(input())
tmp = input().split(' ')

A = []
for i in range(N):
    A.append(int(tmp[i]))

A = np.asarray(A)

z = np.asarray([x for x in range(N)])
A = A - z

b_ceil = np.ceil(np.median(A)).astype(np.int32)
b_floor = np.floor(np.median(A)).astype(np.int32)

A_ceil = A - b_ceil
A_ceil = np.absolute(A_ceil)
A_floor = A - b_floor
A_floor = np.absolute(A_floor)

#pdb.set_trace()
print(np.min((A_ceil.sum(), A_floor.sum())).astype(np.uint32))

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
tmp = input().split(' ')

A = []
for i in range(N):
    A.append(int(tmp[i]))

A = np.asarray(A)

z = np.asarray([x for x in range(N)])
A = A - z

b = np.median(A)
A = A - b
A = np.abs(A)
print(A.sum().astype(np.uint8))

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
tmp = input().split(' ')

A = []
for i in range(N):
    A.append(int(tmp[i]))

A = np.asarray(A)
print(A.max() - A.min())

Submission status: Runtime Error

Solution code:
import copy
input()
a=[int(i) for i in input().split()]
sa=copy.copy(a)
for i in range(len(a)):
    sa[i]=sa[i]-(i+1)
sa.sort()
msa=sa[int(len(sa)/2)]
sb=0
for i in range(len(a)):
    sb=sb+abs(a[i]-(msa+i+1))
print(sb)

Submission status: Runtime Error

Solution code:
import copy
input()
a=[int(i) for i in input().split()]
sa=copy.copy(a)
for i in range(len(a)):
    sa[i]=sa[i]-(i+1)
sa.sort()
msa=sa[int(len(sa)/2)]
sb=0
for i in range(len(a)):
    sb=sb+abs(a[i]-(sma+i+1))
print(sb)

Submission status: Runtime Error

Solution code:
import copy
input()
a=[int(i) for i in input().split()]
sa=copy.copy(a)
for i in range(len(a)):
    sa[i]=sa[i]-(i+1)
sa.sort()
b=sa[int(len(sa)/2)]
sb=0
for i in range(len(a)):
    sb=sb+abs(a[i]-(b+i+1))
print(sb)

Submission status: Runtime Error

Solution code:
import copy
input()
a=[int(i) for i in input().split()]
sa=copy.copy(a)
for i in range(len(a)):
    sa[i]=sa[i]-(i+1)
sa.sort()
b=sa[int(len(sa)/2)]
c=sa[int(len(sa)/2)+1]
sb=0
sc=0
for i in range(len(a)):
    sb=sb+abs(a[i]-(b+i+1))
    sc=sc+abs(a[i]-(c+i+1))
print(min(sb,sc))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

A.sort()
print(A)
median = A[N//2]

for i in range(N):
    A[i] -= median
    A[i] = abs(A[i])
print(sum(A))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!coding:utf-8

n=int(input())
i=n*2

for a in range(i,2,-1):
    if a%n==0:
        if a%2==0:
           ans=a


print(ans)

Submission status: Runtime Error

Solution code:
a = 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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*-coding=utf-8-*-
n = int(input))
if n%2:
    n *= 2
print(n)

Submission status: Runtime Error

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