TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
import fractions
from functools import reduce
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

inpl = lambda: list(map(int,input().split()))
N, X = inpl()
x = inpl()
y = [ p - X for p in x ]
print(gcd_list(y))

inpl = lambda: list(map(int,input().split()))
def gcd(a, b):
    if a < 0: a = -a
    if b < 0: b = -b
    while b > 0:
        (a, b) = (b, a % b)
    return a

N, X = inpl()
x = inpl()
D = abs(x[0]-X)
for i in range(1,N):
  D = gcd(D, x[i]-X)
print(D)

Verdicts: Wrong Answer

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
n,s=map(int,input().split())
l=[abs(int(i)-s) for i in input().split()]
ans=l[0]
for i in l:
  a=ans
  b=0
  while a and i:
    a//=i
    b=a
    a=i
    i=b
  ans=max(a,i)
print(ans)

n,s=map(int,input().split())
l=[abs(int(i)-s) for i in input().split()]
ans=l[0]
def gc(a,d):
  ai=a;bi=d
  a,d=min(ai,bi),max(ai,bi)
  if a==0:return d
  else:return gc(d%a,a)
  
  
for i in l:
  ans=gc(ans,i)
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
import functools as ft

N,X = map(int, input().split(" "))
Xi = [int(a) for a in input().split()]


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

def gcd_list(numbers):
    return ft.reduce(gcd,numbers)

def minusX(a):
    return abs(a-X)


Xi = map(minusX,Xi)

def main():
    output = minusX(gcd_list(Xi))
    print(output)

if __name__ == "__main__":
    main()


import functools as ft

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

def gcd_list(numbers):
    return ft.reduce(gcd,numbers)

N, X = map(int, input().split(" "))
Xi = [int(a) for a in input().split()]

def MinusX(Xi_):
    return abs(Xi_-X)

def main(Xi):
    Xi = map(MinusX,Xi)
    output = gcd_list(Xi)
    print(output)

if __name__ == "__main__":
    main(Xi)


Verdicts: Wrong Answer

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


input_list1 = list(map(int, input().split()))
input_list2 = list(map(int, input().split()))
#input_list1 = [3, 81]
#input_list2 = [33, 105, 57]
N = input_list1[0]
X = input_list1[1]

#print('N:', N)
#print('X:', X)


input_list2.append(X)
input_list2.sort()
#print(input_list2)


ans_list = []
for i, target in enumerate(input_list2):
    if i == N:
        break
    aa = input_list2[i + 1] - input_list2[i]
    #print(input_list2[i + 1], '-' , input_list2[i])
    ans_list.append(aa)


ans_list = set(ans_list)

ans_list = [27, 18, 9, 3]


if len(ans_list) > 1:
    print(gcd_list(ans_list))
else:
    print(min(ans_list))

import math
from functools import reduce

#import math
from functools import reduce

def gcd_list(numbers):
    def gcd(a, b):
        if (b == 0):
            return a;
        return gcd(b, a % b)

    return reduce(gcd, numbers)


input_list1 = list(map(int, input().split()))
input_list2 = list(map(int, input().split()))
#input_list1 = [3, 81]
#input_list2 = [33, 105, 57]
N = input_list1[0]
X = input_list1[1]

#print('N:', N)
#print('X:', X)


input_list2.append(X)
input_list2.sort()
#print(input_list2)


ans_list = []
for i, target in enumerate(input_list2):
    if i == N:
        break
    aa = input_list2[i + 1] - input_list2[i]
    #print(input_list2[i + 1], '-' , input_list2[i])
    ans_list.append(aa)


ans_list = set(ans_list)


if len(ans_list) > 1:
    print(gcd_list(ans_list))
else:
    print(min(ans_list))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
def lcm(a, b):
  if b > a:
    a, b = b, a
  
  while b != 0:
    a, b = b, a % b
  
  return a

city_num, start = map(int, input().split())

cities = list(map(int, input().split()))

for i in range(len(cities)):
  cities[i] = abs(start - cities[i])

cities.sort()
  
a = reduce(lcm, cities)  

print(a)


from functools import reduce

def lcm(a, b):
  if b > a:
    a, b = b, a
  
  while b != 0:
    a, b = b, a % b
  
  return a

city_num, start = map(int, input().split())

cities = list(map(int, input().split()))

for i in range(len(cities)):
  cities[i] = abs(start - cities[i])

cities.sort()
  
a = reduce(lcm, cities)  

print(a)


Verdicts: Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
# coding: utf-8
import time
import re
import math

def main():
    n,start=map(int,input().split())
    X=list(map(int,input().split()))
    mx=0
    dmx=0
    for a in X:
        dmx=max([dmx,abs(start-x)])
    for D in range(1,dmx+1):
        f=1
        for a in range(n):
            if (X[a]-start)%D!=0:
                f=0
        if f==1:
            mx=max([mx,D])
    print(mx)
main()

# coding: utf-8
import time
import re
import math

def main():
    n,start=map(int,input().split())
    X=list(map(int,input().split()))
    now=abs(X[0]-start)
    for xi in range(1,n):
        now=GCD(now,abs(X[xi]-start))
    print(now)
def GCD(a,b):
    if a%b==0:
        return b
    else:
        return GCD(b,a%b)
main()

Verdicts: Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
N, X = map(int, input().split())
xs = map(int, input().split())
xs.append(X)
xs.sort()
xs = [_ - xs[0] for _ in xs]
diffs = [xs[i]-xs[i-1] for i in range(1, len(xs))]
def gcd(a, b):
  if(a>b): return gcd(b, a)
  if a % b == 0:
    return b
  else:
    r = a % b
    return gcd(b, r)

prev = diffs[0]
for cur in diffs[1:]:
  prev = gcd(prev, cur)
print(prev)

N, X = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(X)
xs.sort()
xs = [_ - xs[0] for _ in xs]
diffs = [xs[i]-xs[i-1] for i in range(1, len(xs))]
def gcd(a, b):
  if(a>b): return gcd(b, a)
  if a % b == 0:
    return b
  else:
    r = a % b
    return gcd(b, r)

prev = diffs[0]
for cur in diffs[1:]:
  prev = gcd(prev, cur)
print(prev)

N, X = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(X)
xs.sort()
xs = [_ - xs[0] for _ in xs]
diffs = [xs[i]-xs[i-1] for i in range(1, len(xs))]
def gcd(a, b):
    if(a>b): return gcd(b, a)
    if a % b == 0:
      return b
    else:
      r = a % b
      return gcd(b, r)

prev = diffs[0]
for cur in diffs[1:]:
    prev = gcd(prev, cur)
print(prev)

N, X = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(X)
xs.sort()
xs = [_ - xs[0] for _ in xs]
diffs = [xs[i]-xs[i-1] for i in range(1, len(xs))]
def gcd(a, b):
    if(a<b): return gcd(b, a)
    if a % b == 0:
      return b
    else:
      r = a % b
      return gcd(b, r)

prev = diffs[0]
for cur in diffs[1:]:
    prev = gcd(prev, cur)
print(prev)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
import math


n, x = map(int,input().split())
li_x = list(map(int,input().split()))

for i in range(len(li_x)):
  if li_x[i] - x < 0:
    li_x[i] =x - li_x[i]
  else:
    li_x[i] = li_x[i] -x

if len(li_x)==1:
  print(li_x[0])

elif len(li_x)==2:
  print(gcd(li_x[0],li_x[1]))

else:
  g =gcd(li_x[0],li_x[1])
  k=2
  while k<len(li_x):
    g=gcd(g,li_x[k])
    k+=1
  print(g)

def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)


import math

def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)

n, x = map(int,input().split())
li_x = list(map(int,input().split()))

for i in range(len(li_x)):
  if li_x[i] - x < 0:
    li_x[i] =x - li_x[i]
  else:
    li_x[i] = li_x[i] -x

if len(li_x)==1:
  print(li_x[0])

elif len(li_x)==2:
  print(gcd(li_x[0],li_x[1]))

else:
  g =gcd(li_x[0],li_x[1])
  k=2
  while k<len(li_x):
    g=gcd(g,li_x[k])
    k+=1
  print(g)




Verdicts: Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
from functools import reduce

def gcd(a, b):
    if b > 0:
        return gcd(b, a%b)
    else:
        return a

def gcd_list(arg_list):
    return reduce(gcd, arg_list)

N, X = tuple(map(int, input().split(" ")))
Xs = list(map(int, input().split(" ")))
r = gcd_list(Xs)
print(r)


import math
from functools import reduce
def gcd(arg_list):
    return reduce(math.gcd, arg_list)

N, X = tuple(map(int, input().split(" ")))
Xs = list(map(int, input().split(" ")))
r = gcd(Xs)
print(r)


from functools import *
N, X = list(map(int, input().split(" ")))
xs = list(map(int, input().split(" ")))
xs = list(map(lambda x: X-x if X>x else x-X, xs))
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b) 
r = reduce(gcd, d)
print(r)


from functools import *
N, X = list(map(int, input().split(" ")))
xs = list(map(int, input().split(" ")))
xs = list(map(lambda x: X-x if X>x else x-X, xs))
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b) 
r = reduce(gcd, xs)
print(r)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
N,X = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
L = []

if (len(x) == 1):
  print(abs(X-x[0]))
else:
  L.append(abs(X-x[0]))
  for k in range(len(x)):
    p = abs(X-x[k])
    if (p < L[0]):
      if (L[0] % p != 0):
        print('1')
        break
      else:
        if (L[0] == 1):
          print('1')
        else:
          del L[0]
          L.append(p)
          print(L[0])

N,X = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
L = []
 
if (len(x) == 1):
  print(abs(X-x[0]))
else:
  L.append(abs(X-x[0]))
  for k in range(len(x)):
    p = abs(X-x[k])
    if (p < L[0]):
      if (L[0] % p != 0):
        print('1')
        break
      else:
        if (L[0] != 1):
          del L[0]
          L.append(p)
        print(L[0])

N,X = map(int,input().split())
L = list(map(int,input().split()))
for i in range(N):
  L[i] = abs(L[i]-X)
L.sort()
def gcd(x,y):
  while y != 0:
    k = x
    x = y
    y = k%y
  return x
cur = L[0]
for i in range(1,N):
  cur = gcd(L[i],cur)
print(cur)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
def gcd(a, b):
    while a > 0:
        a, b = b, a%b
    return b

n, x = map(int, input().split())
town = list(map(int, input().split()))

res = abs(town[0] - x)
for t in town[1:]:
    d = abs(t - x)
    res = gcd(res, d)

print(res)

def gcd(a, b):
    while a > 0:
        if a < b:
            a, b = b, a
        a = a % b
    return b

n, x = map(int, input().split())
town = map(int, input().split())

distance = (abs(x-y) for y in town)
print(distance)
for d in distance:
    res = gcd(next(d), next(d))

print(res)


from math import gcd
from fractions import reduce

n, x = map(int, input().split())
town = map(int, input().split())

dist = map(lambda y: abs(x - y), town)
res = reduce(gcd, dist)
print(res)

def gcd(a, b):
    while a > 0:
        a = a % b
        a, b = b, a
    return b

n, x = map(int, input().split())
town = list(map(int, input().split()))

res = abs(town[0] - x)
for t in town[1:]:
    d = abs(t - x)
    res = gcd(res, d)

print(res)

import sys
input = sys.stdin.readline

def gcd(a, b):
    while a > 0:
        if a < b:
            a, b = b, a
        a = a % b
    return b

def main():
    n, x = map(int, input().split())
    town = map(int, input().split())

    distance = (abs(x-y) for y in town)
    res = next(distance)
    for d in distance:
        if d % res != 0:
            res = gcd(res, d)

    print(res)

if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
N,X = map(int, input().split())
target = list(map(int, input().split()))

distances = [abs(i - X) for i in target]

def GCD(x,y):
    if x == 0:
        return y
    else:
        return GCD(y, x % y)
res = 0
for d in distances:
    res = GCD(res, d)
print(res)

N,X = map(int, input().split())
target = list(map(int, input().split()))

distances = [abs(i - X) for i in target]

def GCD(x,y):
    if y == 0:
        return x
    else:
        return GCD(y, x % y)
res = 0
for d in distances:
    res = GCD(res, d)
print(res)

Verdicts: Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left

def main():
	N, X = map(int, input().split(" "))
	L = input().split(" ")
	L = [int(s) for s in L]
	
	if N == 1:
		print(abs(L[0]-X))
		sys.exit()
	
	L.sort()
	tmp = bisect_left(L, X)
	max1 = L[tmp]
	min = 2000000001
	if tmp != 0:
		min1 = L[tmp-1]
	
	ans = min(abs(max1-X), abs(X-min1))
	
	print(ans)
		
	
if __name__ == "__main__":
	main()


# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left

def main():
	N, X = map(int, input().split(" "))
	L = input().split(" ")
	L = [int(s) for s in L]
	
	if N == 1:
		print(abs(L[0]-X))
		sys.exit()
	
	L.sort()
	tmp = bisect_left(L, X)
	
	max = 2000000001
	if tmp < len(L)
		max1 = L[tmp]
	
	min1 = 2000000001
	if tmp != 0:
		min1 = L[tmp-1]
	
	ans = min(abs(max1-X), abs(X-min1))
	
	print(ans)
		
	
if __name__ == "__main__":
	main()


# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left

def gcd(a, b):
	if a > b:
		a, b = b, a
		
	while a > 0:
		a, b = b % a, a
	return b
	
def main():
	N, X = map(int, input().split(" "))
	L = input().split(" ")
	L = [int(s) for s in L]
	
	if N == 1:
		print(abs(L[0]-X))
		sys.exit()
	
	L.sort()
	tmp = bisect_left(L, X)
	
	max1 = 2000000001
	if tmp < len(L):
		max1 = L[tmp]
	
	min1 = 2000000001
	if tmp != 0:
		min1 = L[tmp-1]
	
	seed = 0
	mark = -1
	if abs(max1-X) < abs(X-min1):
		seed = abs(max1-X)
		mark = tmp
	else:
		seed = abs(X-min1)
		mark = tmp-1
	
	ans = 2000000001
	for i, val in enumerate(L):
		if i == mark:
			continue
		tmp = abs(L[i] - L[mark])
		ans_tmp = gcd(tmp, seed)
		if ans > ans_tmp:
			ans = ans_tmp
	
	print(ans)
		
	
if __name__ == "__main__":
	main()


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
N=int(input())
last = input()
wds = set([last])
res = "Yes"
for i in range(N-1):
    wd = input()
    if wd in wds or last[-1]!=wd[0]: 
        ans = "No"
        break
    last = wd
    wds.add(wd)
print(ans)

def gcd(a, b):
    if a > b:
        a, b = b, a
    while a:
        a, b = b%a, a
    return b
N,x1 = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(x1)
xs.sort()
margin = [y-x for y,x in zip(xs[1:],xs[:-1])]
m = margin[0]
for x in margin[1:]:
    m = gcd(m,x)
print(m)

Verdicts: Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
import math
n, init = map(int, input().split())
x = list(map(lambda a: int(a)-init, input().split()))
g = x[0]
for i in range(n-1):
    if g == 1:
        break
    elif x[i+1] % g != 0:
        g = math.gcd(g,x[i+1])
print(g)


n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)


Verdicts: Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
N,X = map(int,input().split())
list = [int(x) for x in input().split()]
list_dist = sorted([abs(x - X) for x in list])

def gcd(a, b):
    if a < b:
        a , b = b , a
    while b:
        a, b = b, a % b
    return a

ans = list_dist[0]

for x in list_dist[1:]:
    result = gcd(result,x)

print(result)

import functools
N,X = map(int,input().split())
list = list(map(int,input().split()))
diff_x = [abs(X-i) for i in list]

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

print(functools.reduce(gcd,diff_x))

Verdicts: Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
from fractions import gcd
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

N, X = map(int, input().split())
nums = list(map(int, input().split()))
nums.append(X)
nums.sort()
dists = []

for i in range(N):
    dist = nums[i + 1] - nums[i]
    dists.append(dist)
    
D = gcd(*dists)

print(D)

import math
from functools import reduce

N, X = map(int, input().split())
nums = list(map(int, input().split()))
nums = list(map(lambda i: abs(i - X), nums))

D = reduce(gcd, nums)
print(D)

n, x = map(int, input().split())
A = [int(i) for i in input().split()]
D = []

for i in range(n):
    D.append(abs(x - A[i]))
    
def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

for i in range(n - 1):
    D[i + 1] = gcd(D[i], D[i + 1])
    
print(D[-1])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
N,X = map(int,input().split())
L = list(map(int,input().split()))

M = [abs(i - X) for i in L]

D = []


for m in range(0,len(M)):
  for i in range(0,len(M)):
    if M[m] % M[i] == 0:
      D.append(M[m])
      
print(max(D))


N,X = map(int,input().split())

L = list(map(int,input().split()))

M = sorted([abs(i - X) for i in L])

m = min(M)

print(M)

if m == 0:
  print(m)
else:
  for i in range(0,len(M)):
    if M[i] % m > 0:
      print(1)
      break
  else:print(m)

N,X = map(int,input().split())
D = list(map(int,input().split()))

dist = [abs(X - D[i]) for i in range(N)]

def gcd(a,b):
  if b == 0:
    return a
  else:
    return gcd(b,a % b)
    
D = 0   
    
for i in range(N):
  D = gcd(D,dist[i])
  
print(D)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N cities on a number line. The i-th city is located at coordinate x_i.  Your objective is to visit all these cities at least once.  In order to do so, you will first set a positive integer D.  Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:    * Move 1: travel from coordinate y to coordinate y + D.   * Move 2: travel from coordinate y to coordinate y - D.  Find the maximum value of D that enables you to visit all the cities.  Here, to visit a city is to travel to the coordinate where that city is located.

Submission attempts (in order):
N,X=map(int,input().split())
x=list(map(int,input().split()))
L=x+[X]
if N==1:
	print(abs(X-x[0]))
else:
	LL=[L[i+1]-L[i] for i in range(N)]
	M=min(LL)
	while any([l%M!=0 for l in LL]):
		M=M-1
	print(M)

N,X=map(int,input().split())
x=list(map(int,input().split()))
L=x+[X]
if N==1:
	print(abs(X-x[0]))
else:
	LL=[abs(L[i+1]-L[i]) for i in range(N)]
	def gcd(a,b):
		while b>0:
			a,b=b,a%b
		return a
	def GCD(LIST):
		if len(LIST)==2:
			return gcd(LIST[0],LIST[1])
		else:
			return([gcd(LIST[0],LIST[1])]+LIST[2::])
	print(GCD(LL))

from functools import reduce
N,X=map(int,input().split())
x=list(map(int,input().split()))
L=x+[X]
if N==1:
	print(abs(X-x[0]))
else:
	LL=[abs(L[i+1]-L[i]) for i in range(N)]
	def gcd(a,b):
		while b>0:
			a,b=b,a%b
		return a
	print(reduce(gcd,LL))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
K=int(input())
print((k/2)*((k+1)/2))

k=int(input())
print((k/2)*((k+1)/2))

k=int(input())
print((k/2)∗((k+1)/2))

k=int(input())
print((k//2)*((k+1)//2))

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
n = int(input())

if n % 2 == 0:
    print((n / 2) ** 2)
else:
    print(((n+1)/2) * (n-1)/2)

n = int(input())

if n % 2 == 0:
    print((n / 2) ** 2)
else
    print(((n+1)/2) * (n-1)/2)

n = int(input())

if n % 2 == 0:
    print(int((n / 2) ** 2))
else:
    print(int(((n+1)/2) * (n-1)/2))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k = int(input())
s = 0
for x in range(1, k + 1):
  for y in range(x, k + 1):
    if y % 2 == 1 and x % 2 == 0:
      s = s + 1
print(s)


k = int(input())
s = 0
for x in range(2, k + 1, 2):
  for y in range(x, k + 1):
    if y % 2 == 1:
      s += 1
print(s)

k = int(input())
s = 0
for x in range(1, k + 1):
  for y in range(1, k + 1):
    if y % 2 == 1 and x % 2 == 0:
      s = s + 1
print(s)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
import math

all_number =  K * K
even_number =  math.floor(K/2) * math.floor(K/2)
odd_number = math.ceil(K/2) * math.ceil(K/2)
answer = (all_number - even_number - odd_number)/2
print(answer)

import math
K = input()
all_number =  K * K
even_number =  math.floor(K/2) * math.floor(K/2)
odd_number = math.ceil(K/2) * math.ceil(K/2)
answer = (all_number - even_number - odd_number)/2
print(answer)

import math
K = int(input())
all_number =  K * K
even_number =  math.floor(K/2) * math.floor(K/2)
odd_number = math.ceil(K/2) * math.ceil(K/2)
answer = (all_number - even_number - odd_number)/2
print(answer)

import math

all_number =  K * K
even_number =  math.floor(all_number/2)*math.floor(all_number/2)
odd_number = math.ceil(all_number/2)*math.ceil(all_number/2)
answer = (all_number - even_number - odd_number)/2

import math
K = int(input())
all_number =  K * K
even_number =  math.floor(K/2) * math.floor(K/2)
odd_number = math.ceil(K/2) * math.ceil(K/2)
answer = (all_number - even_number - odd_number)/2
print(int(answer))

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
import numpy as np


def num_even_odd(num):
  num_odd = np.ceil(num/2)
  num_even = num//2
  return num_odd, num_even


def main(num):
  odds, evens = num_even_odd(num)
  print(odds * evens)


if __name__ == "__main__":
  main(input())

import numpy as np


def num_even_odd(num):
    num_odd = np.ceil(num/2)
    num_even = num//2
    return num_odd, num_even


def main(num):
    odds, evens = num_even_odd(num)
    print(int(odds * evens))


if __name__ == "__main__":
    main(int(input()))

Verdicts: Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
print((int(input())//2)*(int(input())-(int(input())//2))

print((int(input())//2)*(int(input())-int(input())//2))

N=int(input())
print((N//2)*(N-N//2))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
108proA
k = int(input())
ans = (k//2) * ((k+1)//2)
print(ans)

k = int(input())
ans = (k//2) * ((k+1)//2)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):

k=int(input())

if k%2==0:print(int((k/2)**2))
else:print(int((k/2)*(k-1)/2))


k=int(input())

if k%2==0:print(int((k/2)**2))
else:print(int(-(-k//2)*((k-1)/2)))

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k=int(input())
print(k//2*//2 if k%2==0 else k//2*(k+1)//2)

k=int(input())
print((k//2)**2 if k%2==0 else(k//2)*(k+1)//2)


Verdicts: Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
K=int(input())
if K % 2 ==0:
  print((K//2)**2)
else:
  print((K+1)*(K-1))

K=int(input())
if K % 2 ==0:
  print((K//2)**2)
else:
  print((K+1)*(K-1)//4)

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k = input()
k = int(k)
if k % 2 == 0:
    print((k/2)**2)
else:
    print(k//2)*(k//2+1)

k = int(input())
print(int(k//2)*((k+1)//2))

Verdicts: Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
n = int(input())
print((k/2)*((k+1)/2))

k = int(input())
print(k//2 * (k - k//2))

Verdicts: Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
a=int(input())
if(a%2==0):
  ans=(a/2)**2
  return ans
else:
  ans=((a-1)/2)*((a+1)/2)
  return ans
print(ans)

a=int(input())
if a%2==0:
  ans=(a/2)**2
else:
  ans=((a-1)/2)*((a+1)/2)
print(ans)

input(a)
if(a%2==1)
	i=(a+1)/2
	j=(a-1)/2
else 
	i=a/2
	j=a/2
print(i+j)

input(a)
if(a%2==1):
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i+j)

a=int(input())
if(a%2==0):
  ans=(a/2)**2
  return
else:
  ans=((a-1)/2)*((a+1)/2)
  return
print(ans)

input(a)
if a%2==1:
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i*j)

a=input()
if(a%2==0):
  print((a/2)**2)
  return
else:
  print(((a-1)/2)*((a+1)/2))

a=input()
if(a%2==0):
  ans=(a/2)**2
  return
else:
  ans=((a-1)/2)*((a+1)/2)
  return
print(ans)

a=int(input())
if a%2==0:
  ans=(a/2)**2
  return
else:
  ans=((a-1)/2)*((a+1)/2)
  return
print(ans)

input(a)
if(a%2==1):
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i*j)

input(a)
if a/2==0:
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i*j)

a=int(input())
if a%2==0:
  ans=int((a/2)**2)
else:
  ans=int(((a-1)/2)*((a+1)/2))
print(ans)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
x = int(input())

if x % 2 == 0:
  print(int((x//2)**2))
else:
  print(int((x//2)*((x//2)+1))


x = int(input())

if x % 2 == 0:
  print(int((x//2)**2))
else:
  print(int((x//2)*((x//2)+1)))


Verdicts: Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k = int(input())
if k%2 ==0:
  print((k/2)*(k/2))
else:
  print(((k+1)/2)*((k-1)/2))

k = int(input())
if k%2 =0:
  print((k/2)**2)
else:
  print(((k+1)/2)*((k-1)/2))

k = int(input())
if k%2 ==0:
  print((k//2)*(k//2))
else:
  print(((k+1)//2)*((k-1)//2))


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
K = int(input())

ev = K//2
odd = k//2 + K%2
print(ev*odd)

K = int(input())
 
ev = K//2
odd = K//2 + K%2
print(ev*odd)

Verdicts: Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
    if val1 % 2 == 0:
        print(int((val1 / 2) * (val1 / 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 / 2) * (val1 / 2)) - (val1 / 2)))

aa

k=input()  
odd=1
even=0
for i in range(2,k+1): 
     if i%2==0:
        even+=1
     else:
           odd+=1
print(odd*even)

    if n & 1 == 0:
        print((n // 2) ** 2)
    else:
        print((n // 2) * (n // 2 + 1))

    if val1 % 2 == 0:
        print(int((val1 / 2) * (val1 / 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 / 2) * (val1 / 2)) - (val1 / 2)))

val1=int(input())
if val1%2==0:
    print((val1/2)*(val1/2))
else:
    val1=val1+1
    print(((val1/2)*(val1/2))-(val1/2)

if val1 % 2 == 0:
        print(int((val1 // 2) * (val1 // 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 // 2) * (val1 // 2)) - (val1 // 2)))

    if val1 % 2 == 0:
        print(int((val1 // 2) * (val1 // 2)))
    else:
        val1 = val1 + 1
        print(int(((val1 // 2) * (val1 // 2)) - (val1 // 2)))

val1=int(input())
if val1%2==0:
    print((val1//2)*(val1//2))
else:
    val1=val1+1
    print(((val1//2)*(val1//2))-(val1//2))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k = int(input())
if k%2 == 0:
    print(int((k/2)**2))
else:
    print(int(k/2 * (k+1)/2))

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

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
# cook your dish here
import numpy as np
if __name__ == '__main__':
    xy = [int(i) for i in input().split()]
    a1 = np.array([xy[0], xy[1]])
    a2 = np.array([xy[2], xy[3]])
    b = a2 - a1
    r = np.pi / 2
    rot = np.matrix((
        (np.cos(r), np.sin(r)),
        (-np.sin(r), np.cos(r))
    ))
    c = np.dot(b, rot)
    a3 = a2+c
    a4 = a1+c
    print('{} {} {} {}'.format(np.round(a3[0,0]), np.round(a3[0,1]), np.round(a4[0,0]), np.round(a4[0,1])))


if __name__ == '__main__':
    K = input()
    odds = int(K+1)/2
    even = K/2
    print(odds*even)

if __name__ == '__main__':
    K = int(input())
    odds = int(K+1/2)
    even = int(K/2)
    print(odds*even)

if __name__ == '__main__':
    K = int(input())
    odds = int((K+1)/2)
    even = int(K/2)
    print(odds*even)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
K = int(input())
print(pow(K//2,2)) if K % 2 == 0 else print(pow((K+1)//2,2))

K = int(input())
print(K*K//4) if K % 2 == 0 else print(K//2*((K+1)//2))


Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
team=input()
x=team[0]
flag=0
d=0
for i in range(Len(team)):
   if team[i]==x:
       flag+=1
   else:
        x=team[i]
        flag=0
   if flag==7:
       print("yes")
        d=1
       break
if d!=1:
    print("no")


n=input (int()) 
x=0
if n%2==0:
    x=(n/2)**2
else:
    x=((n//2)+1)*(n//2)
print(x)

k =int(input())
z = k / 2
m = z * z
x = (k + 1)/2
y = x * (x - 1)
if k % 2 == 0 :
    print(m)
else :
    print(y)


k = int(input())
if k%2 == 0:
    evens = k/2
    odds = k/2
    total = evens*odds
else:
    evens = (k-1)/2
    odds = k - evens
    total = evens*odds
print(total)


N=int(input("enter number")) 
even=0
odd=0
if N%2==0:
    even=N/2
    odd=N/2
else:
    even=N//2
    odd=(N//2) +1
print(even*odd)

k=input()
pair=0
odd=0
even=0
for i in range(1,k+1) 
     if i%2==0:
        even+=1
     else:
            odd+=1
print(odd*even)



k = map(int, input())
if k%2 == 0:
    evens = k/2
    odds = k/2
    total = evens*odds
else:
    evens = (k-1)/2
    odds = k - evens
    total = evens*odds
print(total)


K = map(int, input().split())
if K%2 ==0:
    print((K/2) ** 2)
else:
    print((K**2 - 1)/4)


n=int(input())
m=list(range(1,n+1))
even=[]
odd=[]
for x in range (0,len(m)):
    if m[x]%2==0:
        even.append(m[x])
    else: odd.append(m[x])

output = [[a, b] for a in even
          for b in odd ]
print(output)

N=int(input("enter number")) 
even=0
odd=0
if N%2==0:
    even=N/2
    odd=N/2
else:
    even=N/2
    odd=(N/2)+1
print(even*odd) 

x = int(input())

y = x // 2
z = (x - y) * y
print(z)


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
K = int(input())

if K % 2 == 0:
	ans = (K // 2)  * (K//2 -1)
else:
	ans = (K//2)**2
print(ans)

K = int(input())

if K % 2 == 0:
	ans = (K // 2)**2
else:
	ans = (K//2)*(K//2 +1)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
def get(n):
  if(n%2==0):
    return ((n//2)**2)
  else:
    return (((n//2)**2)+(n-1)/2)
n=int(input())
z=get(n)
print (z)

def get(n):
  if(n%2==0):
    return ((n//2)**2)
  else:
    return (((n//2)**2)+(n-1)/2)
n=int(input())
z=get(n)
print (z)

def get(n):
  if(n%2==0):
    return ((n//2)**2)
  elif(n==1):
    return (0)  
  else:
    return (((n//2)**2)+(n-1)//2)

n=int(input())
z=get(n)
print (z)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k = int(input())

if k%2==0:
    ans = k/2*k/2
elif k%2 != 0:
    ans = (k//2+1)*k/2

ans = int(ans)
print(ans)

k = int(input())

if k%2==0:
    ans = k/2*k/2
else:
    ans = ((k//2)+1)*(k//2)


ans = int(ans)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
l = map(int, input().split())
a=list(l)
x1=a[0]
y1=a[1]
x2=a[2]
y2=a[3]
x=x2-x1
y=y2-y1
x3=x2-y
y3=y2+x
x4=x1-y
y4=y1+x
c=[x3, y3, x4, y4]
print(c[0], c[1], c[2], c[3])


l = map(int, input().split())
a=list(l)
x=a[2]-a[0]
y=a[3]-a[1]
x3=a[2]-y
y3=a[3]+x
x4=a[1]-y
y4=a[1]+x
print(x3, y3, x4, y4)


l = map(int, input().split())
a=list(l)
x1=a[0]
y1=a[1]
x2=a[2]
y2=a[3]
x=x2-x1
y=y2-y1
x3=x2-y
y3=y2+x
x4=x1-y
y4=y1+x
c=[x3, y3, x4, y4]
print(c[0], c[1], c[2], c[3])

l = map(int, input().split())
a=list(l)
print(a[2]-(a[3]-a[1]), a[3]+a[2]-a[0], a[1]-(a[3]-a[1]), a[1]+a[2]-a[0])


N= int(input())
print(N//2 * (N-N//2))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
s = int(input())
if s % 2 == 1:
  Odd = (s+1)/2
  Even = Odd -1
else:
  Odd = s/2
  Even = Odd
res=Odd * Even
print(res)

s = int(input())
if s % 2 == 1:
  Odd = (s+1)/2
  Even = Odd -1
else:
  Odd = s/2
  Even = Odd
res= int(Odd) * int(Even)
print(res)

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k = int(input())
res = k/2;
if k % 2 == 0 :
	print(int(res*res))
else:
	print(int((res+1)*res))

k = int(input())
res = int(k/2);
if k % 2 == 0 :
	print(int(res*res))
else:
	print(int((res+1)*res))

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k=int(input())
print((k/2)*((k+1)/2))

k=int(input())
print((k//2)*((k+1)//2))

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
import math

K = int(input())
if K % 2 == 0:
    print((K / 2) ** 2)
else:
    print((K / 2) * ((K / 2) + 1))

import math

K = int(input())
if K % 2 == 0:
    print(int((K / 2) ** 2))
else:
    print(int((K / 2) * ((K / 2) + 1)))

import math

K = int(input())
if K % 2 == 0:
    print(int((K / 2) ** 2))
else:
    print(int((K / 2) * ((K / 2) + 1)))

import math

K = int(input())
if K % 2 == 0:
    print(int((K / 2) ** 2))
else:
    print(math.floor(K / 2) * (math.floor(K / 2) + 1))


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
k = int(input())
if k%2 == 0:
    print((k-1)**2//2)
else:
    print((k**2-1)//2)

k = int(input())
if k%2 == 0:
    print(k**2//4)
else:
    print((k**2-1)//4)

Verdicts: Wrong Answer

Accepted
Problem: Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.

Submission attempts (in order):
a=int(input())
b=a/2
if a//2==0:
  print(a*a)
else:
  print(b*(b-1))

a=int(input())
b=a/2
if a%2==0:
  print(b*b)
else:
  print(b*(b+1))

a=int(input())
b=a//2
if a%2==0:
  print(b*b)
else:
  print(b*(b+1))

Verdicts: Wrong Answer

Wrong Answer

Accepted