Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

import sys
input = sys.stdin.readline

bit = lambda s, j: (s >> j) & 1

def f(n, a):
    mod = int(1e9 + 7)
    sn = 1 << n
    dp = [[0] * sn for _ in range(n + 1)]
    dp[0][0] = 1
    for i in range(n):
        dpi = dp[i]
        dpi1 = dp[i + 1]
        ai = a[i]
        for s in range(0, sn):
            if dpi[s]:
                for j in range(n):
                    if bit(s, j) == 0 and ai[j]:
                        s_ = s | 1 << j
                        dpi1[s_] += dpi[s]
                        if dpi1[s_] > mod:
                            dpi1[s_] -= mod
    return(dp[-1][-1])

n = int(input()) # 1 <= n <= 21
a = [list(map(int, input().split())) for _ in range(n)]
print(f(n, a))


Fixed submission:
# coding: utf-8

import sys
input = sys.stdin.readline

bit = lambda s, j: (s >> j) & 1

def f(n, a):
    mod = int(1e9 + 7)
    sn = 1 << n
    dp = [[0] * sn for _ in range(n + 1)]
    dp[0][0] = 1
    for i in range(n):
        dpi = dp[i]
        dpi1 = dp[i + 1]
        ai = a[i]
        for s in range(0, sn):
            if dpi[s]:
                for j in range(n):
                    if bit(s, j) == 0 and ai[j]:
                        s_ = s | 1 << j
                        dpi1[s_] += dpi[s]
                        if dpi1[s_] > mod:
                            dpi1[s_] -= mod
    return(dp[-1][-1])

n = int(input()) # 1 <= n <= 21
a = [list(map(int, input().split())) for _ in range(n)]
print(f(n, a))
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

import sys
input = sys.stdin.readline

from functools import lru_cache
@lru_cache(maxsize = None)
def f(s):
    # 分けない場合
    p = 0
    for i in range(N):
        for j in range(i + 1, N):
            if (s >> i) & 1 and (s >> j) & 1:
                p += a[i][j]
    t = s
    while True:
        t = (t - 1) & s
        if not t:
            break
        p_ = f(t) + f(t ^ s)
        if p < p_:
            p = p_
    return(p)

N = int(input()) # 1 <= N <= 16
a = [list(map(int, input().split())) for _ in range(N)]
print(f(2 ** (N + 1) - 1))


Fixed submission:
# coding: utf-8

import sys
input = sys.stdin.readline

def f(s):
    if flag[s]:
        return(memo[s])
    # 分けない場合
    p = 0
    for i in range(N):
        for j in range(i + 1, N):
            if (s >> i) & 1 and (s >> j) & 1:
                p += a[i][j]
    t = s
    while True:
        t = (t - 1) & s
        if not t:
            break
        p_ = f(t) + f(t ^ s)
        if p < p_:
            p = p_
    flag[s] = 1
    memo[s] = p
    return(p)

N = int(input()) # 1 <= N <= 16
a = [list(map(int, input().split())) for _ in range(N)]
memo = [0] * (1 << N)
flag = [0] * (1 << N)
print(f((1 << N) - 1))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

import sys
input = sys.stdin.readline

from functools import lru_cache
@lru_cache(maxsize = None)
def f(s):
    # 分けない場合
    p = 0
    for i in range(N):
        for j in range(i + 1, N):
            if (s >> i) & 1 and (s >> j) & 1:
                p += a[i][j]
    t = s
    while True:
        t = (t - 1) & s
        if not t:
            break
        p_ = f(t) + f(t ^ s)
        if p < p_:
            p = p_
    return(p)

N = int(input()) # 1 <= N <= 16
a = [list(map(int, input().split())) for _ in range(N)]
print(f(2 ** (N + 1) - 1))


Fixed submission:
# coding: utf-8

import sys
input = sys.stdin.readline

def f(s):
    if flag[s]:
        return(memo[s])
    # 分けない場合
    p = 0
    for i in range(N):
        for j in range(i + 1, N):
            if (s >> i) & 1 and (s >> j) & 1:
                p += a[i][j]
    t = s
    while True:
        t = (t - 1) & s
        if not t:
            break
        p_ = f(t) + f(t ^ s)
        if p < p_:
            p = p_
    flag[s] = 1
    memo[s] = p
    return(p)

N = int(input()) # 1 <= N <= 16
a = [list(map(int, input().split())) for _ in range(N)]
memo = [0] * (1 << N)
flag = [0] * (1 << N)
print(f((1 << N) - 1))
Buggy python submission (verdict: Runtime Error):
n, x = (int(i) for i in input().split())
l_array = [int(i) for i in input().split()]

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    if counter = n+1:
        break
    else:
        coordinate += l_array[counter-1]


print(counter)


Fixed submission:
n, x = (int(i) for i in input().split())
l_array = [int(i) for i in input().split()]

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    if counter == n+1:
        break
    else:
        coordinate += l_array[counter-1]


print(counter)

Buggy python submission (verdict: Runtime Error):
n, x = (int(i) for i in input().split())
l_array = [int(i) for i in input().split()]

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    coordinate += l_array[counter-1]

print(counter)


Fixed submission:
n, x = (int(i) for i in input().split())
l_array = [int(i) for i in input().split()]

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    if counter == n+1:
        break
    else:
        coordinate += l_array[counter-1]


print(counter)

Buggy python submission (verdict: Runtime Error):
n, x = (int(i) for i in input().split())
l_array = [int(i) for i in input().split()]

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    coordinate += l_array[counter]
    counter+=1

print(counter)


Fixed submission:
n, x = (int(i) for i in input().split())
l_array = [int(i) for i in input().split()]

counter = 0
coordinate = 0

while counter < n+1 and coordinate<=x:
    counter+=1
    if counter == n+1:
        break
    else:
        coordinate += l_array[counter-1]


print(counter)
Buggy python submission (verdict: Runtime Error):
r, d, x = (int(i) for i in input().split())

for i in range(10):
  x = r * x - d
  print(x)



Fixed submission:
a, b = (int(i) for i in input().split())
res =0
if a>=13 :
  res = b
elif a<=5:
  res = 0
else:
  res = int(b/2)
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = (int(i) for i in input().split())
ok = [1] * n
for i in range(1,m+1):
  tmp_l, tmp_r = (int(j) for j in input().split())
  filter_array = [1 if tmp_l<=k<=tmp_r else 0 for k in range(1,n+1)]
  ok = [x*y for (x,y) in zip(ok, filter_array)]
print(sum(ok))

Fixed submission:
n, m = (int(i) for i in input().split())
ok = [1] * n
l, r = (1,n)
for i in range(1,m+1):
  tmp_l, tmp_r = (int(j) for j in input().split())
  if l < tmp_l:
    l = tmp_l
  if r > tmp_r:
    r = tmp_r

print( r-l+1 if r-l+1>0 else 0 )
Buggy python submission (verdict: Runtime Error):
X,Y = int(input().split(' '))
print(X + (Y/2))

Fixed submission:
X,Y = input().split(' ')
x = int(X)
y = int(Y)

print(x + (y//2))

Buggy python submission (verdict: Runtime Error):
X,Y = int(input.split(' '))
print(X + (Y/2))

Fixed submission:
X,Y = input().split(' ')
x = int(X)
y = int(Y)

print(x + (y//2))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)

Fixed submission:
import numpy as np
x = input()
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
import numpy as np
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)

Fixed submission:
import numpy as np
x = input()
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
import numpy as np
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)

Fixed submission:
import numpy as np
x = input()
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int, B.strip().split())))

L_sum = 0
jump = 1

for i in range(N+1):
  L_sum += L[i]
  if(L_sum>X):
    jump += 0
  else:
    jump += 1

print(jump)




Fixed submission:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int, B.strip().split())))

L_sum = 0
jump = 1

for i in range(N):
  L_sum += L[i]
  if(L_sum>X):
    jump += 0
  else:
    jump += 1

print(jump)

Buggy python submission (verdict: Runtime Error):
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(map(int,B.split( )))
L_sum = 0
jump = 1
for i in range(N+1):
  L_sum += L[i]
  if(L_sum<X):
    jump += 1 
  else:
    jump += 0

print(jump)

Fixed submission:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int, B.strip().split())))

L_sum = 0
jump = 1

for i in range(N):
  L_sum += L[i]
  if(L_sum>X):
    jump += 0
  else:
    jump += 1

print(jump)

Buggy python submission (verdict: Runtime Error):
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int,B.split( ))))
L_sum = 0
jump = 1
for i in range(N+1):
  L_sum += L[i]
  if(L_sum<X):
    jump += 1 
  else:
    jump += 0

print(jump)

Fixed submission:
import numpy as np

A = input()
B = input()

N,X = map(int,A.split())
L = np.array(list(map(int, B.strip().split())))

L_sum = 0
jump = 1

for i in range(N):
  L_sum += L[i]
  if(L_sum>X):
    jump += 0
  else:
    jump += 1

print(jump)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
print(N)

Fixed submission:
a, b, c = map(int, input().split())
sums = [a+b,b+c,c+a]
print(min(sums))

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))

Fixed submission:
a, b, c = map(int, input().split())
sums = [a+b,b+c,c+a]
print(min(sums))
Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

b = []

for i in range(0,N):
	b.append(a[i])
	b.reverse()
	
for i in range(0,N):
	sys.stdout.write(str(b[i]))
	sys.stdout.write(" ")

Fixed submission:
import sys

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

for i in range(0,N):
	if N-1-i*2 >= 0:
		sys.stdout.write(str(a[N-1-i*2]))
		sys.stdout.write(" ")
	elif (N % 2) == 1:
		sys.stdout.write(str(a[int((i-(N-1)/2)*2-1)]))
		sys.stdout.write(" ")
	else:
		sys.stdout.write(str(a[int((i-N/2)*2)]))
		sys.stdout.write(" ")
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, T = map(int, input().split())
costs = []
times = []
for i in np.arange(N):
    ci, ti = map(int, input().split())
    costs.append(ci)
    times.append(ti)
index = np.argmin(times)
t_min = times[index]
if t_min < T:
    print(costs[index])
else:
    print('TLE')


Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    print(A+B)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
ans = []
for _ in range(Q):
    l, r = map(int, input().split())
    ans.append(S[l-1:r].count('AC'))

for i in ans:
    print(i)

Fixed submission:
N, Q = map(int, input().split())
S = input()

t = [0] * N
t[0] = 0
for i in range(1,N):
    if S[i-1] == 'A' and S[i] == 'C':
        t[i] = t[i-1] + 1
    else:
        t[i] = t[i-1]

ans = []
for _ in range(Q):
    l, r = map(int, input().split())
    ans.append(t[r-1] - t[l-1])

for a in ans:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
for i in range(Q):
    l, r = map(int, input().split())
    print(S[l-1:r].count('AC'))

Fixed submission:
N, Q = map(int, input().split())
S = input()

t = [0] * N
t[0] = 0
for i in range(1,N):
    if S[i-1] == 'A' and S[i] == 'C':
        t[i] = t[i-1] + 1
    else:
        t[i] = t[i-1]

ans = []
for _ in range(Q):
    l, r = map(int, input().split())
    ans.append(t[r-1] - t[l-1])

for a in ans:
    print(a)
Buggy python submission (verdict: Runtime Error):
a_hands = [*input()]
b_hands = [*input()]
c_hands = [*input()]
turn = 'a'

while True:
    if turn == 'a':
        if len(a_hands) == 0:
            print('A')
            break
        turn = a_hands.pop(0)
    elif turn == 'b':
        if len(b_hands) == 0:
            print('B')
            break
        turn = b_hands.pop(0)
    elif turn == 'c':
        if len(c_hands) == 0:
            print('C')
            break
        turn = c_hands.pop(0)


Fixed submission:
a_hands = list(input())
b_hands = list(input())
c_hands = list(input())
turn = 'a'

while True:
    if turn == 'a':
        if len(a_hands) == 0:
            print('A')
            break
        turn = a_hands.pop(0)
    elif turn == 'b':
        if len(b_hands) == 0:
            print('B')
            break
        turn = b_hands.pop(0)
    elif turn == 'c':
        if len(c_hands) == 0:
            print('C')
            break
        turn = c_hands.pop(0)

Buggy python submission (verdict: Runtime Error):
a_hands = [*input()]
b_hands = [*input()]
c_hands = [*input()]
turn = 'a'

while True:
    if turn == 'a':
        if len(a_hands) == 0:
            print('A')
            break
        turn = a_hands.pop(0)
    elif turn == 'b':
        if len(b_hands) == 0:
            print('B')
            break
        turn = b_hands.pop(0)
    elif turn == 'c':
        if len(c_hands) == 0:
            print('C')
            break
        turn = c_hands.pop(0)


Fixed submission:
a_hands = list(input())
b_hands = list(input())
c_hands = list(input())
turn = 'a'

while True:
    if turn == 'a':
        if len(a_hands) == 0:
            print('A')
            break
        turn = a_hands.pop(0)
    elif turn == 'b':
        if len(b_hands) == 0:
            print('B')
            break
        turn = b_hands.pop(0)
    elif turn == 'c':
        if len(c_hands) == 0:
            print('C')
            break
        turn = c_hands.pop(0)
Buggy python submission (verdict: Runtime Error):
w = sorted(input())
ret = 'Yes'
for i in range(0, len(w), 2):
    if w[i] != w[i+1]:
        ret = 'No'
        break
print(ret)

Fixed submission:
w = sorted(input())
ret = 'Yes'
if len(w) % 2 == 0:
    for i in range(0, len(w)-1, 2):
        if w[i] != w[i+1]:
            ret = 'No'
            break
else:
    ret = 'No'
print(ret)
Buggy python submission (verdict: Runtime Error):
ret = []
for s in input():
    if s == 'B':
        ret.pop()
    else:
        ret.append(s)
print(''.join(ret))

Fixed submission:
ret = []
for s in input():
    if s == '0' or s == '1':
        ret.append(s)
    elif len(ret) > 0:
        ret.pop()
print(''.join(ret))
Buggy python submission (verdict: Runtime Error):
from collections import OrderedDict
if __name__ == "__main__":
    NM = list(map(int, input().split()))
    n = NM[0]
    m = NM[1]
    mydict = {}
    for i in range(n):
        money_can = list(map(int, input().split()))
        money = money_can[0]
        can = money_can[1]
        if(money not in mydict.keys()):
            mydict[money] = []
        mydict[money].append(can)
    buynow = 0
    moneynow = 0

    mydict = OrderedDict(sorted(mydict.items()))
    for i in mydict.keys():
        if(buynow >= m):
            break
        for canNO in mydcit[i]:
            if(buynow >= m):
                break
            if(can + buynow <= m):
                moneynow += can*i
                buynow += can
            else:
                need = m - buynow
                moneynow += need*i
                buynow += need
        else:
            continue
    print(moneynow)

    

Fixed submission:
from collections import OrderedDict
if __name__ == "__main__":
    NM = list(map(int, input().split()))
    n = NM[0]
    m = NM[1]
    mydict = {}
    for i in range(n):
        money_can = list(map(int, input().split()))
        money = money_can[0]
        can = money_can[1]
        if(money not in mydict.keys()):
            mydict[money] = []
        mydict[money].append(can)
    buynow = 0
    moneynow = 0

    mydict = OrderedDict(sorted(mydict.items()))
    for i in mydict.keys():
        if(buynow >= m):
            break
        for canNO in mydict[i]:
            if(buynow >= m):
                break
            if(canNO + buynow < m):
                moneynow += canNO*i
                buynow += canNO
            else:
                need = m - buynow
                moneynow += need*i
                buynow += need
        else:
            continue
    print(moneynow)
Buggy python submission (verdict: Runtime Error):
N,X = map(int,input().split())
li = list(map(int,input().split()))

point=0
count=1
for i in li:
  point += i
  if point<=X:
    count+=1
print(count)

Fixed submission:
x,A = map(int,input().split())
if x<A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;

count = 0
for i in range(1,N+1):
  for j in range(M):
    if  i < listA[j][0] or listA[j][1] < i:
      print(i)
      break;
    if j == M-1:
      count += 1


print(count)

Fixed submission:
x,y = map(int,input().split())
if x >= 13:
  print(y)
elif 6 <= x <= 12:
  print(int(y/2))
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x > 12:
  print(y)
else if 6 <= x <= 12:
  print(y/2)
else:
  print(0)

Fixed submission:
x,y = map(int,input().split())
if x >= 13:
  print(y)
elif 6 <= x <= 12:
  print(int(y/2))
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
 
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
    
count = 0
for i in range(1,N+1):
  for j in range(M):
    if  i < listA[j][0] or listA[j][1] < i:
      break;
    if j == M-1:
      count += 1
print(count)

Fixed submission:
N,M = map(int,input().split())

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
L=[]
R=[]
for i in listA:
  L.append(i[0])
  R.append(i[1])
maxL = max(L)
minR = min(R)

count = 0
for i in range(1,N+1):
  if maxL <= i <= minR:
    count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())

listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
        #または、quit(),os.exit()をして止める。

#print(listA)
#[[1, 2, 2, 3, 1], [4, 5, 3, 4, 1, 2, 3, 4], [2, 3, 5, 6, 0, 2]]
    
count = 0
for i in range(1,N+1):
  count1 = 0
  for j in range(M):
    if  i < listA[j][0] or listA[j][1] < i:
      break;
    if j == M-1:
      count += 1
print(count)

Fixed submission:
N,M = map(int,input().split())

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
L=[]
R=[]
for i in listA:
  L.append(i[0])
  R.append(i[1])
maxL = max(L)
minR = min(R)

count = 0
for i in range(1,N+1):
  if maxL <= i <= minR:
    count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())

listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
        #または、quit(),os.exit()をして止める。

#print(listA)
#[[1, 2, 2, 3, 1], [4, 5, 3, 4, 1, 2, 3, 4], [2, 3, 5, 6, 0, 2]]
    
count = 0
for i in range(1,N+1):
  count1 = 0
  for j in range(M):
    if listA[j][0] <= i <= listA[j][1]:
      count1 += 1
  if count1 == M:
  	count += 1
  count1 = 0
print(count)

Fixed submission:
N,M = map(int,input().split())

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
L=[]
R=[]
for i in listA:
  L.append(i[0])
  R.append(i[1])
maxL = max(L)
minR = min(R)

count = 0
for i in range(1,N+1):
  if maxL <= i <= minR:
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import math
n, X = map(int, input().split())

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

x.append(X)

sorted_x = sorted(x)
sorted_aaa = []

aaa = []

for (i, item) in enumerate(sorted_x):
    if i == 0:
        continue
    aaa.append(int(sorted_x[i] - sorted_x[i - 1]))

sorted_aaa = sorted(aaa)
res = 1 << 99

for (k, elm) in enumerate(sorted_aaa):
    # if elm % sorted_aaa[0] != 0:
    #     res = 1
    if len(sorted_aaa) == 1:
        res = sorted_aaa[k]
        break
    if k == 0:
        continue
    g = math.gcd(sorted_aaa[k - 1], sorted_aaa[k])
    if g < res:
        res = g

print(res)

Fixed submission:
n, X = map(int, input().split())

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

def gcd(a, b):
    """Calculate the Greatest Common Divisor of a and b.

    Unless b==0, the result will have the same sign as b (so that when
    b is divided by it, the result comes out positive).
    """
    while b:
        a, b = b, a%b
    return a

def solve():
    x.append(X)

    sorted_x = sorted(x)
    sorted_aaa = []

    aaa = []

    for (i, item) in enumerate(sorted_x):
        if i == 0:
            continue
        aaa.append(int(sorted_x[i] - sorted_x[i - 1]))

    sorted_aaa = sorted(aaa)
    res = 100000000
    # from math import gcd
    for (k, elm) in enumerate(sorted_aaa):
        if len(sorted_aaa) == 1:
            res = sorted_aaa[k]
            break
        if k == 0:
            continue
        g = gcd(sorted_aaa[k - 1], sorted_aaa[k])
        if g < res:
            res = g
    print(res)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, input().split())

diffx = x1 - x2
diffy = y1 - y2

len_of_v = int((diffx ** 2 + diffy ** 2) ** 0.5)

if diffx == 0:
    x3 = x2 + diffy
    x4 = x1 + diffy
    y3 = y2
    y4 = y1
else:
    grad = diffy / diffx
    counter_grad = -1 / grad

    x3 = x2 + diffy
    y3 = y2 + diffy * counter_grad

    x4 = x1 + diffy
    y4 = y1 + diffy * counter_grad

print(int(x3), round(y3), int(x4), int(y4))



Fixed submission:
import math
x1, y1, x2, y2 = map(int, input().split())

diffx = x1 - x2
diffy = y1 - y2

len_of_v = int((diffx ** 2 + diffy ** 2) ** 0.5)

if diffx == 0:
    x3 = x2 + diffy
    x4 = x1 + diffy
    y3 = y2
    y4 = y1
elif diffy == 0:
    x3 = x2
    x4 = x1
    y3 = y2 - diffx
    y4 = y1 - diffx
else:
    grad = diffy / diffx
    counter_grad = -1 / grad

    x3 = x2 + diffy
    y3 = y2 + diffy * counter_grad

    x4 = x1 + diffy
    y4 = y1 + diffy * counter_grad

print(round(x3), round(y3), round(x4), round(y4))