TnT/CodeNet4Repair huggingface dataset:
Problem:
A university student, Takahashi, has to take N examinations and pass all of them. Currently, his _readiness_ for the i-th examination is A_{i}, and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i-th examination.  Takahashi thinks that he may not be able to pass all the examinations, and he has decided to ask a magician, Aoki, to change the readiness for as few examinations as possible so that he can pass all of them, while not changing the total readiness.  For Takahashi, find the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the following conditions:    * The sum of the sequence A_1, A_2, ..., A_{N} and the sum of the sequence C_1, C_2, ..., C_{N} are equal.   * For every i, B_i \leq C_i holds.  If such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.

Incorrect submission (verdict: Wrong Answer):
from math import fabs
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
tarinai = []
amari = []
for i in range(n):
    if a[i] - b[i] < 0:
        tarinai.append(a[i] - b[i])
    elif a[i] - b[i] > 0:
        amari.append(a[i] - b[i])
tarinai.sort()
amari.sort()
amari.reverse()

ans = 0
if fabs(sum(tarinai)) > sum(amari):
    print('-1')
else:
    ans += len(tarinai)
    val = fabs(sum(tarinai))
    for i in range(n+1):
        print(val)
        if val <= 0:
            break
        val -= amari[i]
        ans += 1

    print(ans)

Fixed, accepted submission:
from math import fabs
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
tarinai = []
amari = []
for i in range(n):
    if a[i] - b[i] < 0:
        tarinai.append(a[i] - b[i])
    elif a[i] - b[i] > 0:
        amari.append(a[i] - b[i])
tarinai.sort()
amari.sort()
amari.reverse()

ans = 0
if fabs(sum(tarinai)) > sum(amari):
    print('-1')
else:
    ans += len(tarinai)
    val = fabs(sum(tarinai))
    for i in range(n+1):
        #print(val)
        if val <= 0:
            break
        val -= amari[i]
        ans += 1

    print(ans)
Problem:
We have a 3 \times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.   According to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.   Determine if he is correct.

Incorrect submission (verdict: Wrong Answer):
C = [0] * 3
A = [0] * 3
B = [0] * 3

for j in range(3):
    C[j] = [int(x) for x in input().split()]
print(C)
B[0], B[1], B[2] = C[0][0], C[0][1], C[0][2]
A[1], A[2] = C[1][0]-B[0], C[2][0]-B[0]
flag = 0
for i in range(3):
    for k in range(3):
        if C[i][k] != A[i] + B[k]:
            flag = 1
            break
if flag == 1:
    print("No")
else:
    print("Yes")


Fixed, accepted submission:
C = [0] * 3
A = [0] * 3
B = [0] * 3

for j in range(3):
    C[j] = [int(x) for x in input().split()]
#print(C)
B[0], B[1], B[2] = C[0][0], C[0][1], C[0][2]
A[1], A[2] = C[1][0]-B[0], C[2][0]-B[0]
flag = 0
for i in range(3):
    for k in range(3):
        if C[i][k] != A[i] + B[k]:
            flag = 1
            break
if flag == 1:
    print("No")
else:
    print("Yes")
Problem:
Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Wrong Answer):
import sys
N = list(map(int, input()))
op = ['+','-']
for i in op:
    tmp = 0 
    ans = []
    for j in op:
        for k in op:
            if i == '+':
                tmp = N[0] + N[1]
                ans.append('+')
            else:
                tmp = N[0] - N[1]
                ans.append('-')

            if j == '+':
                tmp += N[2]
                ans.append('+')
            else:
                tmp -= N[2]    
                ans.append('-')

            print(k)
            if k == '+':
                tmp += N[3]
                ans.append('+')
            else:
                tmp -= N[3]
                ans.append('-')

            if tmp == 7:
                print(str(N[0])+ans[0]+str(N[1])+ans[1]+str(N[2])+ans[2]+str(N[3])+"=7")
                sys.exit()
            else:
                tmp = 0
                ans = []

Fixed, accepted submission:
S = input()
ans = 0
f = ""
for i in range(1 << len(S)-1):
    f = S[0]
    for j in range(len(S)-1):
        if ((i >> j) & 1) == 1:
            f += "+"
        else:
            f += "-"
        f += S[j+1]
    if eval(f) == 7:
        print(f+"=7")
        exit()
Problem:
Takahashi loves numbers divisible by 2.  You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.  Here, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.  For example,    * 6 can be divided by 2 once: 6 -> 3.   * 8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.   * 3 can be divided by 2 zero times.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
key = [2**int(x) for x in range(6, -1)]
for value in key:
  if value <= n:
    print(value)
    break

Fixed, accepted submission:
n = int(input())
key = [2**int(x) for x in range(6, -1, -1)]
for value in key:
  if value <= n:
    print(value)
    break
Problem:
Square1001 has seen an electric bulletin board displaying the integer 1. He can perform the following operations A and B to change this value:    * Operation A: The displayed value is doubled.   * Operation B: The displayed value increases by K.  Square1001 needs to perform these operations N times in total. Find the minimum possible value displayed in the board after N operations.

Incorrect submission (verdict: Wrong Answer):
a=int(input())
b=int(input())
c=1
for i in range(a):
  if 2*c>=c+b:
    c=2*c
  else:
    c=c+b
print(c)

Fixed, accepted submission:
a=int(input())
b=int(input())
c=1
for i in range(a):
  if 2*c<=c+b:
    c=2*c
  else:
    c=c+b
print(c)
Problem:
There is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white.  Snuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) point was (x_i, y_i).  Then, he created an integer sequence a of length N, and for each 1 ≦ i ≦ N, he painted some region within the rectangle black, as follows:    * If a_i = 1, he painted the region satisfying x < x_i within the rectangle.   * If a_i = 2, he painted the region satisfying x > x_i within the rectangle.   * If a_i = 3, he painted the region satisfying y < y_i within the rectangle.   * If a_i = 4, he painted the region satisfying y > y_i within the rectangle.  Find the area of the white region within the rectangle after he finished painting.

Incorrect submission (verdict: Wrong Answer):
w,h,n=map(int,input().split())
for i in range(n):
  x,y,a=map(int,input().split())
  x_b=w
  x_s=0
  y_b=h
  y_s=0
  if a==1:
    x_b=min(x,x_b)
  elif a==2:
    x_s=max(x,x_s)
  elif a==3:
    y_b=min(y,y_b)
  else:
    y_s=max(y,y_s)
    
print((x_b-x_s)*(y_b-y_s))
    
    
  

Fixed, accepted submission:
w,h,n=map(int,input().split())
x_b=w
x_s=0
y_b=h
y_s=0
for i in range(1,n+1):
  x,y,a=map(int,input().split())
  if a==2:
    x_b=min(x,x_b)
  elif a==1:
    x_s=max(x,x_s)
  elif a==4:
    y_b=min(y,y_b)
  else:
    y_s=max(y,y_s)

if x_b<=x_s or y_b<=y_s:
  print(0)
else:  
  print((x_b-x_s)*(y_b-y_s))
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
n = int(input('h'))
num = n % 1000
change = 1000 - num
print(change)

Fixed, accepted submission:
n = int(input())
num = n % 1000
if num == 0:
    print(0)
else:
    change = 1000 - num
    print(change)
Problem:
E869120 found a chest which is likely to contain treasure.   However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.   He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with `?`.  One more thing he found is a sheet of paper with the following facts written on it:    * Condition 1: The string S contains a string T as a contiguous substring.   * Condition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.  Print the string S.   If such a string does not exist, print `UNRESTORABLE`.

Incorrect submission (verdict: Wrong Answer):

url = "https://atcoder.jp//contests/abc076/tasks/abc076_c"

def main():
    S = input()
    T = input()
    ans = 'UNRESTORABLE'
    for i in range(len(S)):
        if S[i] == T[0]:
            s = S[i:len(T)]
            flg = False
            for j, ss in enumerate(s):
                flg = True if ss == T[j] or ss == '?' else False
            if flg:
                ans = list(S)
                ans[i: i + len(T)] = list(T)
    for a in ans:
        if a == '?':
            print('a', end='')
        else:
            print(a, end='')





if __name__ == '__main__':
    main()


Fixed, accepted submission:

url = "https://atcoder.jp//contests/abc076/tasks/abc076_c"

def main():
    S = input()
    T = input()
    ans = 'UNRESTORABLE'
    words = []
    if S.count('?') == 0:
        print(S)
        exit()

    for i in range(len(S)):
        if S[i] != T[0] and S[i] != '?':
            continue
        s = S[i:i + len(T)]
        if len(s) < len(T):
            continue

        flg = False
        for j, ss in enumerate(s):
            flg = True if ss == T[j] or ss == '?' else False
            if not flg: break
        if flg:
            words.append(S[:i] + T + S[i + len(T):])
    if not words:
        print(ans)
        exit()
    for i in range(len(words)):
        words[i] = words[i].replace('?', 'a')
    words.sort()
    print(words[0])


if __name__ == '__main__':
    main()
Problem:
Snuke has N strings. The i-th string is s_i.  Let us concatenate these strings into one string after arranging them in some order. Find the maximum possible number of occurrences of `AB` in the resulting string.

Incorrect submission (verdict: Wrong Answer):
def main():
    N = int(input())
    s = [input() for _ in range(N)]

    a = 0
    b = 0
    ab = 0

    count = 0

    for i in range(N):
        for j in range(len(s[i])-1):
            if s[i][j:j+2] == 'AB':
                count += 1


    for i in range(N):
        if (s[i][0] == 'B' or s[i][-1] == 'A'):
            print('ok')
            if (s[i][0] == 'B' and s[i][-1] == 'A'):
                ab += 1
            elif (s[i][0] == 'B'):
                b += 1
            else:
                a += 1

    if (a==b==0) and (ab > 0):
        ab -= 1
    print(count+min(a+ab, b+ab))


if __name__=='__main__':
    main()


Fixed, accepted submission:
def main():
    N = int(input())
    s = [input() for _ in range(N)]

    a = 0
    b = 0
    ab = 0

    count = 0

    for i in range(N):
        for j in range(len(s[i])-1):
            if s[i][j:j+2] == 'AB':
                count += 1


    for i in range(N):
        if (s[i][0] == 'B' or s[i][-1] == 'A'):
            if (s[i][0] == 'B' and s[i][-1] == 'A'):
                ab += 1
            elif (s[i][0] == 'B'):
                b += 1
            else:
                a += 1

    if (a==b==0) and (ab > 0):
        ab -= 1
    print(count+min(a+ab, b+ab))


if __name__=='__main__':
    main()
Problem:
An _X -layered kagami mochi_ (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.  Lunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?

Incorrect submission (verdict: Wrong Answer):
n = int(input())
d = [int(input()) for i in range(n)]
set(d)

print(len(d))

Fixed, accepted submission:
n = int(input())
d = [int(input()) for i in range(n)]
print(len(set(d)))
Problem:
There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `Yes` if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print `No` otherwise.

Incorrect submission (verdict: Wrong Answer):
a, b, c = map(int, input().split())
l = [i for i in range(min(a, b), max(a, b) + 1)]
if c in l:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
a, b, c = map(int, input().split())
l = [i for i in range(min(a, b), max(a, b) + 1)]
if c in l:
    print('Yes')
else:
    print('No')
Problem:
English text is not available in this practice contest.  ある貧乏な国のおてんばで勇敢なお姫様は，ある日部屋の壁を壊してお城を抜け出し，競馬などのギャンブルが行われている賭博場に入っていった．ところが，ギャンブルなどやったことのないお姫様は，非常に負けが込んでしまった．この状況をおもしろくないと思ったお姫様は，一体どのような仕組みでギャンブルが行われているかを調べてみた．すると，このようなギャンブルではパリミュチュエル方式と呼ばれる方式で配当が決定されていることを突き止めた．  パリミュチュエル方式とは，競走を対象としたギャンブルにおいて配当を決定するために使用する計算方法である．この方式では，全ての掛け金をプールし，一定の割合を控除した上で，当選者に掛け金に比例した金額を分配する．  現在お姫様が熱中しているギャンブルは，参加者は競技前にどの競技者が優勝するかを予想する 1枚100ゴールドの投票券を購入し，競技の結果が予想と一致すれば当選金を受け取る権利を得るというものである．なお，ゴールドはこの国の通貨単位である．あなたの仕事は入力として与えられる競技の情報をもとに，投票券一枚あたりの配当を計算するプログラムを書くことである．  先述の方法で計算される配当額が整数にならない場合は，切り捨てによって整数にすること．

Incorrect submission (verdict: Wrong Answer):
while True:
    N,M,P = map(int,input().split())
    if N == 0: break
    src = [int(input()) for i in range(N)]
    print(0 if src[M-1] == 0 else (P * sum(src) // src[M-1]))

Fixed, accepted submission:
while True:
    N,M,P = map(int,input().split())
    if N == 0: break
    src = [int(input()) for i in range(N)]
    if src[M-1] == 0:
        print(0)
    else:
        print((100-P) * sum(src) // src[M-1])
Problem:
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Incorrect submission (verdict: Wrong Answer):
a,b = map(int,input().split())
if (a+b)%2 == 0:
  print(a+b)
else:
  print(a+b+1)

Fixed, accepted submission:
a,b = map(int,input().split())
if (a+b)%2 == 0:
  print((a+b)//2)
else:
  print((a+b+1)//2)
Problem:
There are N cities. There are also K roads and L railways, extending between the cities. The i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities. No two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.  We will say city A and B are _connected by roads_ if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads. We will also define _connectivity by railways_ similarly.  For each city, find the number of the cities connected to that city by both roads and railways.

Incorrect submission (verdict: Wrong Answer):
NKL = [int(_) for _ in input().split()]
pq = [[int(_) - 1 for _ in input().split()] for _ in range(NKL[1])]
rs = [[int(_) - 1 for _ in input().split()] for _ in range(NKL[2])]

road = [0] * NKL[0]
road_num = 0
train = [0] * NKL[0]
train_num = 0
for y in pq:
    if road[y[0]] == 0 and road[y[1]] == 0:
        road_num += 1
        road[y[0]] = road_num
        road[y[1]] = road_num
    elif road[y[0]] == 0:
        road[y[0]] = road[y[1]]
    elif road[y[1]] == 0:
        road[y[1]] = road[y[0]]
    else:
        road = [y[0] if _ == y[1] else _ for _ in road]
for y in rs:
    if train[y[0]] == 0 and train[y[1]] == 0:
        train_num += 1
        train[y[0]] = train_num
        train[y[1]] = train_num
    elif train[y[0]] == 0:
        train[y[0]] = train[y[1]]
    elif train[y[1]] == 0:
        train[y[1]] = train[y[0]]
    else:
        train = [y[0] if _ == y[1] else _ for _ in train]
for i in range(NKL[0]):
    t = 0
    for j in range(NKL[0]):
        if i == j or (road[i] == road[j] and train[i] and train[j] and road[i] * road[j] > 0):
            t += 1
    print(t, end=' ')

Fixed, accepted submission:
N, K, L = [int(_) for _ in input().split()]


def find(a, x):
    stack = []
    while a[x] != x:
        stack += [x]
        x = a[x]
    while stack:
        a[stack.pop()] = x
    return x


def unite(a, x, y):
    x = find(a, x)
    y = find(a, y)
    if x != y:
        a[x] = min(x, y)
        a[y] = a[x]


a_road = [i for i in range(N)]
for _ in range(K):
    p, q = [int(_) - 1 for _ in input().split()]
    unite(a_road, p, q)
a_railway = [i for i in range(N)]
for _ in range(L):
    r, s = [int(_) - 1 for _ in input().split()]
    unite(a_railway, r, s)
memo = {}
for i in range(N):
    memo[a_road[i], a_railway[i]] = memo.get(
        (find(a_road, i), find(a_railway, i)), 0) + 1

print(' '.join(str(memo[a_road[i], a_railway[i]]) for i in range(N)))
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
phrase_length=sorted([len(x) for x in input().split()])
print("Yes" if phrase_length[0]==phrase_length[1]==5 and phrase_length[2]==7 else "No")


Fixed, accepted submission:
length=sorted([int(x) for x in input().split()])
print ("YES" if length ==[5,5,7] else "NO")
Problem:
Write a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.

Incorrect submission (verdict: Wrong Answer):
d = { chr(i): 0 for i in range(96, 123) }
s = list(input())
for i in s:
    try:
        d[i.lower()] += 1
    except:
        pass
for i,j in d.items():
    print('{} : {}'.format(i,j))

Fixed, accepted submission:
import sys

d = { chr(i): 0 for i in range(97, 123) }
s = [i for i in sys.stdin]
for i in s:
    i = list(i)
    for c in i:
        try: 
            d[c.lower()] += 1
        except:
            continue
for i,j in d.items():
    print('{} : {}'.format(i,j))
Problem:
Evi has N integers a_1,a_2,..,a_N. His objective is to have N equal **integers** by transforming some of them.  He may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).  Find the minimum total cost to achieve his objective.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
a.sort()
minc = 100000000
for i in a:
    count = 0
    for j in a:
        count += (j - i)** 2
    minc = min(minc, count)

print(minc)

Fixed, accepted submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
minc = 100000000
for i in range(a[0], a[-1] + 1):
    count = 0
    for j in a:
        count += (i - j)** 2
    minc = min(minc, count)

print(minc)
Problem:
Snuke signed up for a new website which holds programming competitions. He worried that he might forget his password, and he took notes of it. Since directly recording his password would cause him trouble if stolen, he took two notes: one contains the characters at the odd-numbered positions, and the other contains the characters at the even-numbered positions.  You are given two strings O and E. O contains the characters at the odd- numbered positions retaining their relative order, and E contains the characters at the even-numbered positions retaining their relative order. Restore the original password.

Incorrect submission (verdict: Wrong Answer):
O = list(input())
E = list(input())
ans = list()
 
for i in range(len(O)):
    ans.append(O[i])
    if len(E) >= i:
        ans.append(O[i])

result = "".join(ans)
print(result)

Fixed, accepted submission:
O = list(input())
E = list(input())
ans = list()
 
for i in range(len(O)):
    ans.append(O[i])
    if len(E) > i:
        ans.append(E[i])

result = "".join(ans)
print(result)
Problem:
We have a cord whose length is a positive integer. We will perform the following condition until the length of the cord becomes at most 2:    * Operation: Cut the rope at two positions to obtain three cords, each with a length of a positive integer. Among these, discard one with the longest length and one with the shortest length, and keep the remaining one.  Let f(N) be the maximum possible number of times to perform this operation, starting with a cord with the length N.  You are given a positive integer X. Find the maximum integer N such that f(N)=X.

Incorrect submission (verdict: Wrong Answer):
print((4<<int(input())+2)-2)

Fixed, accepted submission:
print(2**(int(input())+2)-2)
Problem:
Takahashi received _otoshidama_ (New Year's money gifts) from N of his relatives.  You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either `JPY` or `BTC`, and x_i and u_i represent the content of the otoshidama from the i-th relative.  For example, if x_1 = `10000` and u_1 = `JPY`, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = `0.10000000` and u_2 = `BTC`, the otoshidama from the second relative is 0.1 bitcoins.  If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

Incorrect submission (verdict: Wrong Answer):
n=int(input())
s=0
for i in range(n):
    x,u=input().split()
    if u=="JPY":
        s+=int(x)
    else:
        b=380000.0*float(x)
        s+=int(b)
print(s)

Fixed, accepted submission:
n=int(input())
s=0
for i in range(n):
    x,u=input().split()
    if u=="JPY":
        s+=int(x)
    else:
        b=float(380000.0)*float(x)
        s+=b
print(s)
Problem:
Evi has N integers a_1,a_2,..,a_N. His objective is to have N equal **integers** by transforming some of them.  He may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (See Sample 2).  Find the minimum total cost to achieve his objective.

Incorrect submission (verdict: Wrong Answer):
input()
a = list(map(int, input().split()))
for i in range(min(a),max(a)+1):
    cost_min = 0 if i == min(a) else cost_min
    cost = 0
    for e in a:
        add_cost = abs((e - i)) ** 2
        cost_min += add_cost if i == min(a) else 0
        cost += add_cost if i != min(a) else 0
    print(cost)
    if not i == min(a) and cost_min > cost:
        cost_min = cost
print(cost_min)

Fixed, accepted submission:
input()
a = list(map(int, input().split()))
for i in range(min(a),max(a)+1):
    cost_min = 0 if i == min(a) else cost_min
    cost = 0
    for e in a:
        add_cost = abs((e - i)) ** 2
        cost_min += add_cost if i == min(a) else 0
        cost += add_cost if i != min(a) else 0
    if not i == min(a) and cost_min > cost:
        cost_min = cost
print(cost_min)
Problem:
Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.

Incorrect submission (verdict: Wrong Answer):
n,k=map(int,input().split())
n=n/2+0.5
print(n)
if n>=k:
    print("YES")
else:
    print("NO")



Fixed, accepted submission:
n,k = map(int,input().split())
a=n/2+0.5
if a>=k:
    print("YES")
else:
    print("NO")