TnT/CodeNet4Repair huggingface dataset:
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
import sys

import math
import itertools
import random
n = int(input())
li = [0] * 4  #ac,wa,tle,re
for i in range(n):
    tmp = input()
    if (tmp == "AC"):
        li[0] += 1
    elif (tmp == "WA"):
        li[1] += 1
    elif (tmp == "TLE"):
        li[2] += 1
    else:
        li[3] += 1
print("AC × " + str(li[0]))
print("WA × " + str(li[1]))
print("TLE × " + str(li[2]))
print("RE × "+str(li[3]))


Fixed, accepted submission:
import sys

import math
import itertools
import random
n = int(input())
li = [0] * 4  #ac,wa,tle,re
for i in range(n):
    tmp = input()
    if (tmp == "AC"):
        li[0] += 1
    elif (tmp == "WA"):
        li[1] += 1
    elif (tmp == "TLE"):
        li[2] += 1
    else:
        li[3] += 1
print("AC x " + str(li[0]))
print("WA x " + str(li[1]))
print("TLE x " + str(li[2]))
print("RE x "+str(li[3]))
Problem:
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis.  You planned a trip along the axis. In this plan, you first depart from the point with coordinate 0, then visit the N spots in the order they are numbered, and finally return to the point with coordinate 0.  However, something came up just before the trip, and you no longer have enough time to visit all the N spots, so you decided to choose some i and cancel the visit to Spot i. You will visit the remaining spots as planned in the order they are numbered. You will also depart from and return to the point with coordinate 0 at the beginning and the end, as planned.  For each i = 1, 2, ..., N, find the total cost of travel during the trip when the visit to Spot i is canceled.

Incorrect submission (verdict: Wrong Answer):
import copy
N = int(input())
A_list = list(map(int,input().split()))

for i in range(N):
    li = copy.deepcopy(A_list)
    del li[i]
    ans = abs(li[0] + li[N-2])
    for m in range(N-2):
        ans += abs(li[m] - li[m+1])
    print(ans)

Fixed, accepted submission:
N = int(input())
A_list = list(map(int,input().split()))
a = [0]
b = [0]
point_list = a + A_list + b
S = 0
for i in range(N+1):
    S += abs(point_list[i]-point_list[i+1])

for i in range(1,N+1):
    print(S - abs(point_list[i-1] - point_list[i])
    -abs(point_list[i] - point_list[i+1])
    +abs(point_list[i-1] - point_list[i+1]))
Problem:
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive.  Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him.

Incorrect submission (verdict: Wrong Answer):
inp = list(map(int, input().split()))

res = []
for x in inp:
    res.append(x)
    if res.index(x):
        res.pop()

print(res.__len__())


Fixed, accepted submission:
inp = list(map(int, input().split()))

res = []
for x in inp:
    if not res.__contains__(x):
        res.append(x)

print(res.__len__())
Problem:
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.

Incorrect submission (verdict: Wrong Answer):
x = input()
ans= 0
for i in x:
    if i == 1:
        ans += 1
print(ans)


Fixed, accepted submission:
x = input()
ans= 0
for i in x:
    if i == '1':
        ans += 1
print(ans)
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
la=[]
for i in range(n):
    la+=[input()]
print("AC","×",la.count("AC"))
print("WA","×",la.count("WA"))
print("TLE","×",la.count("TLE"))
print("RE","×",la.count("RE"))


Fixed, accepted submission:
n=int(input())
la=[]
for i in range(n):
    la+=[input()]
print("AC","x",la.count("AC"))
print("WA","x",la.count("WA"))
print("TLE","x",la.count("TLE"))
print("RE","x",la.count("RE"))
Problem:
Joisino wants to evaluate the formula "A op B". Here, A and B are integers, and the binary operator op is either `+` or `-`. Your task is to evaluate the formula instead of her.

Incorrect submission (verdict: Wrong Answer):
a,b,c = input().split()

print(int(a)-int(c))

Fixed, accepted submission:
a,b,c = input().split()

if b == "+":
    print((int(a)+int(c)))
else:
    print(int(a)-int(c))
Problem:
Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).

Incorrect submission (verdict: Wrong Answer):
N, A, B = map(int, input().split())
total = 0

def retuwa(n):
  sum = 0
  while n > 0:
    sum += n % 10 
    n /= 10
  return sum

for i in range(1, N + 1):
  sum = retuwa(i)
  if A <= sum <= B:
    total += i
    
print(total)

Fixed, accepted submission:
N, A, B = map(int, input().split())
total = 0


def ketawa(n):
    sum = 0
    while n >= 1:
        sum += n % 10
        n //= 10
    return sum


for i in range(1, N + 1):
    sum = ketawa(i)
    if A <= sum <= B:
        total += i

print(total)
Problem:
Print all the integers that satisfies the following in ascending order:    * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.

Incorrect submission (verdict: Wrong Answer):
a, b, k = map(int, input().split())

ans = []
for i in range(a, b+1):
  if i <= a+k or i>=b-k:
    if i not in ans:
      ans.append(i)
      print(i)

Fixed, accepted submission:
a, b, k = map(int, input().split())

if b-a <= k:
  for i in range(a, b+1):
    print(i)
else:
  ans = []
  for i in range(a, a+k):
    if i not in ans:
      ans.append(i)
      print(i)
  for j in range(b-k+1, b+1):
    if j not in ans:
      print(j)
Problem:
Write a program which reads a sequence of $n$ integers $a_i (i = 1, 2, ... n)$, and prints the minimum value, maximum value and sum of the sequence.

Incorrect submission (verdict: Wrong Answer):
s=int(input())
x=[int(i) for i in input().split()]
print("{0},{1},{2}".format(min(x),max(x),sum(x)))

Fixed, accepted submission:
s=int(input())
x=[int(i) for i in input().split()]
print("{0} {1} {2}".format(min(x),max(x),sum(x)))
Problem:
Write a program which reads two integers a, b and an operator op, and then prints the value of a op b.  The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-
while True:
    a, op, b= input().split(" ")
    a = int(a)
    b = int(b)
    
    if op == "?":
        break
    elif op == "+":
        print(a+b)
    elif op == "-":
        print(a-b)
    elif op == "*":
        print(a*b)
    elif op == "/":
        print(a/b)

Fixed, accepted submission:
# -*- coding: utf-8 -*-
while True:
    a, op, b= input().split(" ")
    a = int(a)
    b = int(b)
    
    if op == "?":
        break
    elif op == "+":
        print(a+b)
    elif op == "-":
        print(a-b)
    elif op == "*":
        print(a*b)
    elif op == "/":
        print(a//b)
Problem:
Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.  You are given Smeke's current rating, x. Print `ABC` if Smeke will participate in ABC, and print `ARC` otherwise.

Incorrect submission (verdict: Wrong Answer):
x = int(input())
answer = 2*(x-x%11)//11
if x%11==0: pass
elif x%11<7: answer += 1
else: answer += 2
print(answer)

Fixed, accepted submission:
x = int(input())
if x<1200: print("ABC")
else: print("ARC")
Problem:
Write a program which performs a sequence of commands to a given string $str$. The command is one of:    * print a b: print from the a-th character to the b-th character of $str$   * reverse a b: reverse from the a-th character to the b-th character of $str$   * replace a b p: replace from the a-th character to the b-th character of $str$ with p  Note that the indices of $str$ start with 0.

Incorrect submission (verdict: Wrong Answer):
s=input()
for i in range(int(input())):
    sou_com=input().split()
    if sou_com[0]=='print':
        print(s[int(sou_com[1])-1:int(sou_com[2])])
    elif sou_com[0]=='reverse':
        s=s[:int(sou_com[1])-1]\
        +s[int(sou_com[1])-1:int(sou_com[2])][::-1]\
        +s[int(sou_com[2]):]
    elif sou_com[0]=='replace':
        s=s[:int(sou_com[1])-1]\
        +sou_com[3]\
        +s[int(sou_com[2]):]

Fixed, accepted submission:
s=input()
for i in range(int(input())):
    sou_com=input().split()
    if sou_com[0]=='print':
        print(s[int(sou_com[1]):int(sou_com[2])+1])
    elif sou_com[0]=='reverse':
        s=s[:int(sou_com[1])]\
        +s[int(sou_com[1]):int(sou_com[2])+1][::-1]\
        +s[int(sou_com[2])+1:]
    elif sou_com[0]=='replace':
        s=s[:int(sou_com[1])]\
        +sou_com[3]\
        +s[int(sou_com[2])+1:]
Problem:
M-kun has the following three cards:    * A red card with the integer A.   * A green card with the integer B.   * A blue card with the integer C.  He is a genius magician who can do the following operation at most K times:    * Choose one of the three cards and multiply the written integer by 2.  His magic is successful if both of the following conditions are satisfied after the operations:    * The integer on the green card is **strictly** greater than the integer on the red card.   * The integer on the blue card is **strictly** greater than the integer on the green card.  Determine whether the magic can be successful.

Incorrect submission (verdict: Wrong Answer):
a,b,c,k=map(int,open(0).read().split())
for d in range(k):
	if a>=b:b*=2
	else:c*=2
print('YNeos'[a<b<c::2])

Fixed, accepted submission:
a,b,c,k=map(int,open(0).read().split())
while k>0:
	if b<=a:b*=2
	else:c*=2
	k-=1
print('YNeos'[a>=b or b>=c::2])
Problem:
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.

Incorrect submission (verdict: Wrong Answer):
a=list(input())
print(a)
N=0

for i in a:
    if int(i)==1:
        N+=1
        
print(N)

Fixed, accepted submission:
a=list(input())
# print(a)
N=0

for i in a:
    if int(i)==1:
        N+=1
        
print(N)
Problem:
Write a program which finds a pattern $p$ in a ring shaped text $s$.     

Incorrect submission (verdict: Wrong Answer):
z=input()
a=[]
for i in z:
    a+=i
ai=set(a)
b=[]
x=input()
for i in x:
    b+=i
bs=set(b)
print(bs <= ai)

Fixed, accepted submission:
z=input()*2
x=input()
a=z.count(x)

if a>=1:
    print("Yes")
else:
    print('No')
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Wrong Answer):
a = int(input())
i = 0
t = 100
while 1:
    t = int(t * 1.01)
    i += 1
    if t > a:
        break
print(i)

Fixed, accepted submission:
a = int(input())
i = 0
t = 100
while 1:
    t = int(t * 1.01)
    i += 1
    if t >= a:
        break
print(i)
Problem:
A balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L<R.  Takahashi placed a mass of weight A and a mass of weight B on the left pan of a balance scale, and placed a mass of weight C and a mass of weight D on the right pan.  Print `Left` if the balance scale tips to the left; print `Balanced` if it balances; print `Right` if it tips to the right.

Incorrect submission (verdict: Wrong Answer):
a,b,c,d = map(int,input().split())
if a+b == c+d:
  print('Balanced')
elif a+b > c+d:
  print('Right')
else:
  print('Left')

Fixed, accepted submission:
a,b,c,d = map(int,input().split())
if a+b == c+d:
  print('Balanced')
elif a+b > c+d:
  print('Left')
else:
  print('Right')
Problem:
You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:    * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`.

Incorrect submission (verdict: Wrong Answer):
s=input()
s.replace("eraser","")
s.replace("erase","")
s.replace("dreamer","")
s.replace("dream","")

if len(s)==0: print("YES")
else: print("NO")

Fixed, accepted submission:
s=input()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.replace("dreamer","")
s=s.replace("dream","")
if len(s)==0: print("YES")
else: print("NO")
Problem:
There is a triangle formed by three points $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$ on a plain.  Write a program which prints "YES" if a point $P$ $(x_p, y_p)$ is in the triangle and "NO" if not.

Incorrect submission (verdict: Wrong Answer):
def cross_product(a, b):
    ax, ay = a
    bx, by = b
    return ax * by - ay * bx


def sub(a, b):
    a1, a2 = a
    b1, b2 = b
    return b1 - a1, b2 - a2


def judge(p1, p2, p3, pp):
    for a, b in ((p1, p2), (p2, p3), (p3, p1)):
        vec1 = sub(a, b)
        vec2 = sub(a, pp)
        if cross_product(vec2, vec1) >= 0:
            print("NO")
            return
    print("YES")


if __name__ == '__main__':
    inputs = [float(s) for s in input().split()]
    p1 = (inputs.pop(0), inputs.pop(0))
    p2 = (inputs.pop(0), inputs.pop(0))
    p3 = (inputs.pop(0), inputs.pop(0))
    pp = (inputs.pop(0), inputs.pop(0))

    judge(p1, p2, p3, pp)


Fixed, accepted submission:
import sys

def cross_product(a, b):
    ax, ay = a
    bx, by = b
    return ax * by - ay * bx


def sub(a, b):
    a1, a2 = a
    b1, b2 = b
    return b1 - a1, b2 - a2


def judge(p1, p2, p3, pp):

    cnt = 0
    for a, b in ((p1, p2), (p2, p3), (p3, p1)):
        vec1 = sub(a, b)
        vec2 = sub(a, pp)
        if cross_product(vec2, vec1) > 0:
            cnt += 1
    if cnt == 0 or cnt == 3:
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    for line in sys.stdin:
        inputs = [float(s) for s in line.split()]
        p1 = (inputs.pop(0), inputs.pop(0))
        p2 = (inputs.pop(0), inputs.pop(0))
        p3 = (inputs.pop(0), inputs.pop(0))
        pp = (inputs.pop(0), inputs.pop(0))
        judge(p1, p2, p3, pp)
Problem:
10^{10^{10}} participants, including Takahashi, competed in two programming contests. In each contest, all participants had distinct ranks from first through 10^{10^{10}}-th.  The _score_ of a participant is the product of his/her ranks in the two contests.  Process the following Q queries:    * In the i-th query, you are given two positive integers A_i and B_i. Assuming that Takahashi was ranked A_i-th in the first contest and B_i-th in the second contest, find the maximum possible number of participants whose scores are smaller than Takahashi's.

Incorrect submission (verdict: Wrong Answer):
import math,bisect
q = int(input())
for i in range(q):
  a,b = map(int,input().split())
  y = max(a,b)
  z = min(a,b)
  ind = int(math.sqrt(a*b-1))
  cnt = 0
  if ind*(ind+1) < a*b:
    if ind >= z:
      cnt = 1
    if ind+1 >= y:
      cnt = 2
    print(2*ind-cnt)
  else:
    if ind >= z:
      cnt = 1
    if ind >= y:
      cnt = 2
    print(2*ind-1-cnt)

Fixed, accepted submission:
import math
q = int(input())
for i in range(q):
  a,b = map(int,input().split())
  if a == b:
    print(a*2-2)
    continue
  y = max(a,b)
  z = min(a,b)
  ind = math.sqrt(a*b)
  d = int(ind)
  if ind.is_integer():
    d -= 1
  cnt = 0
  if d*(d+1) < a*b:
    if d >= z:
      cnt = 1
    if d+1 >= y:
      cnt = 2
    print(2*d-cnt)
  else:
    if d >= z:
      cnt = 1
    print(2*d-1-cnt)
Problem:
This contest is `CODEFESTIVAL`, which can be shortened to the string `CF` by deleting some characters.  Mr. Takahashi, full of curiosity, wondered if he could obtain `CF` from other strings in the same way.  You are given a string s consisting of uppercase English letters. Determine whether the string `CF` can be obtained from the string s by deleting some characters.

Incorrect submission (verdict: Wrong Answer):
s = input()

if 'CF' in s:
    print('Yes')
else:
    print('No')


Fixed, accepted submission:
s = input()

in_c = False

for c in s:
    if not in_c:
        if 'C' == c:
            in_c = True
    else:
        if 'F' == c:
            print('Yes')
            exit()

print('No')
Problem:
There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

Incorrect submission (verdict: Wrong Answer):
N=int(input())
s=0
for i in range(0,N):
 s=s+i

Fixed, accepted submission:
N=int(input())
s=0
for i in range(0,N+1):
 s=s+i
print(s)
Problem:
A string is called a KEYENCE string when it can be changed to `keyence` by removing its contiguous substring (possibly empty) only once.  Given a string S consisting of lowercase English letters, determine if S is a KEYENCE string.

Incorrect submission (verdict: Wrong Answer):
S = input()
a = len(S)
count=0
for i in range(a):
  for j in range(i+1,a):
    XX= S[:i] +S[j:a]
    
    if XX == 'keyence':
      count +=1
if count == 0:
  print('No')
else:
  print('Yes')

Fixed, accepted submission:
S = input()
a = len(S)
count=0
for i in range(a):
  for j in range(i,a):
    XX= S[:i] +S[j:a]
    
    if XX == 'keyence':
      count +=1
if count == 0:
  print('NO')
else:
  print('YES')
Problem:
You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order.

Incorrect submission (verdict: Wrong Answer):
s = sorted(input())
t = sorted(input())

if s < t:
  print("Yes")
else:print("No")

Fixed, accepted submission:
s = sorted(input())
t = sorted(input())[::-1]

if s < t:
  print("Yes")
else:print("No")
Problem:
There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies.  Snuke can perform the following operation any number of times:    * Choose a box containing at least one candy, and eat one of the candies in the chosen box.  His objective is as follows:    * Any two neighboring boxes contain at most x candies in total.  Find the minimum number of operations required to achieve the objective.

Incorrect submission (verdict: Wrong Answer):
n,x=map(int,input().split())
A=list(map(int,input().split()))
A=[0]+A 
cnt=0
for i in range(n):
    use=(A[i]+A[i+1])-x 
    cnt+=use 
    A[i+1]-=use 

print(cnt)

Fixed, accepted submission:
n,x,*a=map(int,open(0).read().split());t=r=0
for i in a:t=min(i,x-t);r+=i-t
print(r)
Problem:
Given is a rooted tree with N vertices numbered 1 to N. The root is Vertex 1, and the i-th edge (1 \leq i \leq N - 1) connects Vertex a_i and b_i.  Each of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.  Now, the following Q operations will be performed:    * Operation j (1 \leq j \leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.  Find the value of the counter on each vertex after all operations.

Incorrect submission (verdict: Wrong Answer):
N, Q = map(int, input().split())
ki = []
action = []
ans = [0] * (N+1)
for _ in range(N-1):
    array = list(map(int, input().split()))
    ki.append(array)
for i in range(Q):
    array = list(map(int, input().split()))
    action.append(array)
    ans[array[0]] += array[1]

for k in range(N-1):
	ans[ki[k][1]] += ans[ki[k][0]]

print(ans)

Fixed, accepted submission:
import sys
sys.setrecursionlimit(10**7)
N, Q = map(int, input().split())
edges = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)
Query = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    Query[p-1] += x
ans = [0]*N
past = [0]*N
def dfs(start,point):
    past[start] = 1
    point = point + Query[start]
    ans[start] = point
    for target in edges[start]:
        if past[target] == 0:
            dfs(target,point)
dfs(0,0)
print(*ans)
Problem:
Takahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it.  The consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \times 1.08 yen (rounded down to the nearest integer).  Takahashi forgot the price of his apple pie before tax, X, and wants to know it again. Write a program that takes N as input and finds X. We assume X is an integer.  If there are multiple possible values for X, find any one of them. Also, Takahashi's memory of N, the amount he paid, may be incorrect. If no value could be X, report that fact.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a=n//1.08
b=int(a*1.08)
if a==b:
  print(a)
else:
  print(":(")

Fixed, accepted submission:
n=int(input())
a=int(n/1.08)
aa=a-1
aaa=a+1
b=int(a*1.08)
bb=int(aa*1.08)
bbb=int(aaa*1.08)
A=[a,aa,aaa]
B=[b,bb,bbb]
f=0
for i in range(3):
  if B[i]==n:
    f=1
    ans=A[i]
    break
if f==0:
  print(":(")
else:
  print(ans)
Problem:
Let w be a string consisting of lowercase letters. We will call w _beautiful_ if the following condition is satisfied:    * Each lowercase letter of the English alphabet occurs even number of times in w.  You are given the string w. Determine if w is beautiful.

Incorrect submission (verdict: Wrong Answer):
w=input()
for alphabet in w:
    if w.count(alphabet)%2!=0:
        print("NO")
        exit()
print("YES")

Fixed, accepted submission:
w=input()
for alphabet in w:
    if w.count(alphabet)%2!=0:
        print("No")
        exit()
print("Yes")
Problem:
We have an N \times N square grid.  We will paint each square in the grid either black or white.  If we paint exactly A squares white, how many squares will be painted black?

Incorrect submission (verdict: Wrong Answer):
print(int(input())^2 - int(input()))

Fixed, accepted submission:
print(int(input())**2 - int(input()))
Problem:
How many ways are there to choose two distinct positive integers totaling N, disregarding the order?

Incorrect submission (verdict: Wrong Answer):
a = (int)(input())
print(a//2)

Fixed, accepted submission:
a = (int)(input())
print((a-1)//2)