TnT/CodeNet4Repair huggingface dataset:
Problem:
We have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.  Let B be a sequence of K \times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.  Find the inversion number of B, modulo 10^9 + 7.  Here the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \leq i < j \leq K \times N - 1) such that B_i > B_j.

Incorrect submission (verdict: Wrong Answer):
N,K=(input().split())
N,K=int(N),int(K)
seq=list(input().split())
seq=[int(x) for x in seq]
print(seq)
cou=0
C=0
inc=0
for i in range(len(seq)):
    for j in range(i+1,len(seq)):
        if seq[i]>seq[j]: cou+=1
        if seq[i]<seq[j]: inc+=1
for m in range(K):
    C+=((K-m)*cou+m*inc)
print(C%(10**9+7))


Fixed, accepted submission:
N,K=(input().split())
N,K=int(N),int(K)
seq=list(input().split())
seq=[int(x) for x in seq]
cou=0
C=0
inc=0
for i in range(len(seq)):
    for j in range(i+1,len(seq)):
        if seq[i]>seq[j]: cou+=1
for i in range(len(seq)):
    for j in range(len(seq)):
        if seq[i]>seq[j]: inc+=1
C=(K*(K-1)//2)*inc+K*cou
print(C%(10**9+7))
Problem:
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.  The matches for the first k days have finished. You are given the results of Takahashi's matches as a string S consisting of `o` and `x`. If the i-th character in S is `o`, it means that Takahashi won the match on the i-th day; if that character is `x`, it means that Takahashi lost the match on the i-th day.  Print `YES` if there is a possibility that Takahashi can participate in the next tournament, and print `NO` if there is no such possibility.

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

maru = 0
for i in range(len(s)):
  if s[i] == "o":
    maru = maru + 1
if maru >= 8:
  print("YES")
else:
  print("NO")

Fixed, accepted submission:
s=list(input())

maru = 0
batu = 0
for i in range(len(s)):
  if s[i] == "o":
    maru = maru + 1
  else:
    batu = batu + 1
if 15 - maru - batu >= 8 - maru:
  print("YES")
else:
  print("NO")
Problem:
There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N).  For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.  We say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:    * For every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.  Does there exist a good set of choices? If the answer is yes, find one good set of choices.

Incorrect submission (verdict: Wrong Answer):
#d
n = int(input())
a = list(map(int, input().split()))
print(-1)

Fixed, accepted submission:
#d
n = int(input())
a = list(map(int, input().split()))
ans = [0]*len(a)
for i in range(len(a),0,-1):
    if sum(ans[i-1::i])%2 != a[i-1]:
        ans[i-1] = 1
print(sum(ans))
if sum(ans) > 0:
    ans_n = [str(i+1) for i, x in enumerate(ans)  if x==1]
    ans_n=" ".join(ans_n)
    print(ans_n)
Problem:
Write a program which reads three integers, and prints them in ascending order.

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

Fixed, accepted submission:
a = list(map(int, input().split()))
print(' '.join(list(map(str, sorted(a)))))
Problem:
縦 8、横 8 のマスからなる図 1 のような平面があります。   □| □| □| □| □| □| □| □   ---|---|---|---|---|---|---|---   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □      図１   ---       この平面上に、以下の A から G の図形のどれかが一つだけ置かれています。  | A   ---   ■| ■| |   ---|---|---|---   ■| ■| |   | | |   | | |   | B   ---   | ■| |   ---|---|---|---   | ■| |   | ■| |   | ■| |   | C   ---   ■| ■| ■| ■   ---|---|---|---   | | |   | | |   | | |      | D   ---   | ■| |   ---|---|---|---   ■| ■| |   ■| | |   | | |   | E   ---   ■| ■| |   ---|---|---|---   | ■| ■|   | | |   | | |   | F   ---   ■| | |   ---|---|---|---   ■| ■| |   | ■| |   | | |   | G   ---   | ■| ■|   ---|---|---|---   ■| ■| |   | | |   | | |       たとえば、次の図 2 の例では E の図形が置かれています。   | □| □| □| □| □| □| □| □   ---|---|---|---|---|---|---|---   □| □| □| □| □| □| □| □   □| ■| ■| □| □| □| □| □   □| □| ■| ■| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □   □| □| □| □| □| □| □| □      図２   ---       平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した数字の列を読み込んで、置かれている図形の種類（A〜G）を出力するプログラムを作成してください。  ただし、ひとつの平面に置かれている図形は必ず１つで、複数の図形が置かれていることはありません。また、A〜G で表される図形以外のものが置かれていることはありません。

Incorrect submission (verdict: Time Limit Exceeded):
def trim():
    num=[]
    N=[input() for _ in range(8)]
    for x in range(8):
        for y in range(8):
            if N[y][x]=="1":
                if not num:
                    refer=(x,y)
                num.append((x,y))
    num=[(x-refer[0],y-refer[1]) for x,y in num]
    return num
def point(point):
    if point==[(0,0),(0,1),(1,0),(1,1)]:print("A")
    if point==[(0,0),(0,1),(0,2),(0,3)]:print("B")
    if point==[(1,0),(2,0),(3,0),(4,0)]:print("C")
    if point==[(0,0),(0,1),(1,-1),(1,0)]:print("D")
    if point==[(0,0),(1,0),(1,1),(2,1)]:print("E")
    if point==[(0,0),(0,1),(1,1),(1,2)]:print("F")
    if point==[(0,0),(1,-1),(1,0),(2,-1)]:print("G")
while True:
    try:
        point(trim)
    except:break


Fixed, accepted submission:
def trim(N):
    num=[]
    for x in range(8):
        for y in range(8):
            if N[y][x]=="1":
                if not num:
                    refer=(x,y)
                num.append((x,y))
    num=[(x-refer[0],y-refer[1]) for x,y in num]
    return num
def points(point):
    if point==[(0,0),(0,1),(1,0),(1,1)]:print("A")
    if point==[(0,0),(0,1),(0,2),(0,3)]:print("B")
    if point==[(0,0),(1,0),(2,0),(3,0)]:print("C")
    if point==[(0,0),(0,1),(1,-1),(1,0)]:print("D")
    if point==[(0,0),(1,0),(1,1),(2,1)]:print("E")
    if point==[(0,0),(0,1),(1,1),(1,2)]:print("F")
    if point==[(0,0),(1,-1),(1,0),(2,-1)]:print("G")
while True:
    N=[input() for _ in range(8)]
    points(trim(N))
    try:
        input()
    except:break
Problem:
On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in `yyyy/mm/dd` format. For example, January 23, 2018 should be written as `2018/01/23`.  After finishing the document, she noticed that she had mistakenly wrote `2017` at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to `2018` and prints it.

Incorrect submission (verdict: Wrong Answer):
print('2018/01/',input()[8:],end='')

Fixed, accepted submission:
print('2018/01/'+input()[8:])
Problem:
You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`.

Incorrect submission (verdict: Wrong Answer):


import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8')
print('Yes' if set('abc') == set(S) else 'No')


Fixed, accepted submission:


import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8').rstrip()
print('Yes' if set('abc') == set(S) else 'No')
Problem:
We have a long seat of width X centimeters. There are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.  We would like to seat as many people as possible, but they are all very shy, and there must be a gap of length at least Z centimeters between two people, and between the end of the seat and a person.  At most how many people can sit on the seat?

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

while a >= b*x + c*(x+1):
    x += 1

print(x)

Fixed, accepted submission:
a,b,c = map(int,input().split())
x = 1

while a >= b*x + c*(x+1):
    x += 1

print(x-1)
Problem:
You are given a string S of length N consisting of `(` and `)`. Your task is to insert some number of `(` and `)` into S to obtain a _correct bracket sequence_.   Here, a correct bracket sequence is defined as follows:    * `()` is a correct bracket sequence.   * If X is a correct bracket sequence, the concatenation of `(`, X and `)` in this order is also a correct bracket sequence.   * If X and Y are correct bracket sequences, the concatenation of X and Y in this order is also a correct bracket sequence.   * Every correct bracket sequence can be derived from the rules above.  Find the shortest correct bracket sequence that can be obtained. If there is more than one such sequence, find the lexicographically smallest one.

Incorrect submission (verdict: Wrong Answer):
# D - Insertion

N = int(input())
S = input().split("()")

ans = []
for x in S:
    tmp = x
    for _ in range(x.count(")")):
        tmp = "(" + tmp
    for _ in range(x.count("(")):
        tmp += ")"
    ans.append(tmp)

print("()".join(ans))

Fixed, accepted submission:
# D - Insertion

N = int(input())
S = input()

s = S
for _ in range(50):
    s = s.replace("()", "")

ans = "(" * s.count(")") + S + ")" * s.count("(")
print(ans)
Problem:
In _K-city_ , there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?

Incorrect submission (verdict: Wrong Answer):
n,m = input().split()
n = int(n)
m = int(m)
print ((n + 1) * (m + 1))

Fixed, accepted submission:
n,m = input().split()
n = int(n)
m = int(m)
print ((n - 1) * (m - 1))
Problem:
This contest, _AtCoder Beginner Contest_ , is abbreviated as _ABC_.  When we refer to a specific round of ABC, a three-digit number is appended after ABC. For example, ABC680 is the 680th round of ABC.  What is the abbreviation for the N-th round of ABC? Write a program to output the answer.

Incorrect submission (verdict: Wrong Answer):

# N = input()
# print("ABC"+N)

N = int(input())
print("{:03d}".format(N))

Fixed, accepted submission:

# N = input()
# print("ABC"+N)

N = int(input())
print("ABC"+"{:03d}".format(N))
Problem:
You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x?

Incorrect submission (verdict: Wrong Answer):
A, B, X = map(int, input().split())
print((B - A) // X)

Fixed, accepted submission:
A, B, X = map(int, input().split())
if A % X == 0:
  print(B // X - A // X + 1)
else:
  print(B // X - A // X)
Problem:
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.  Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.

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

na, nb, nc = x, y, 0
mx = 10**18
for i in range(max(x,y)):
  if i%2==1: continue
  total = a*(na-i//2) + b*(nb-i//2) + c*i
  if total<mx:
    mx=total

print(mx)

Fixed, accepted submission:
a, b, c, x, y = map(int, input().split())


mx = 10**18
for i in range(0, max(x,y)*2+1):
  if i%2==1: continue
  total = max(a*(x-i//2), 0) + max(b*(y-i//2), 0) + c*i
  if total<mx:
    mx=total

print(mx)
Problem:
There are N + 1 squares arranged in a row, numbered 0, 1, ..., N from left to right.  Initially, you are in Square X. You can freely travel between adjacent squares. Your goal is to reach Square 0 or Square N. However, for each i = 1, 2, ..., M, there is a toll gate in Square A_i, and traveling to Square A_i incurs a cost of 1. It is guaranteed that there is no toll gate in Square 0, Square X and Square N.  Find the minimum cost incurred before reaching the goal.

Incorrect submission (verdict: Wrong Answer):
n, m, x = map(int, input().split())
li = list(map(int, input().split()))


print(min(len(li[:x]), len(li[x+1:])))


Fixed, accepted submission:
n, m, x = map(int, input().split())
li = list(map(int, input().split()))

li = [1 if i in li else 0 for i in range(1, n+1)]

print(min(sum(li[:x-1]), sum(li[x:])))
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())
ans=0
for i in range(n):
    n+=1+i
print(ans)

Fixed, accepted submission:
n = int(input())
ans=0
for i in range(n):
    ans+=1+i
print(ans)
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())

password = []

for i in range(len(e)):
    password.append(o[i])
    password.append(e[i])

if o > e:
    password.append(o[-1])

password = ''.join(password)
print(password)

Fixed, accepted submission:
o = list(input())
e = list(input())

password = []

for i in range(len(e)):
    password.append(o[i])
    password.append(e[i])

if len(o) > len(e):
    password.append(o[-1])

password = ''.join(password)
print(password)
Problem:
For given integers m and n, compute mn (mod 1,000,000,007). Here, A (mod M) is the remainder when A is divided by M.

Incorrect submission (verdict: Wrong Answer):
m,n=(int(i) for i in input().split())
m2=1
while n>0:
    m1=m
    l=1
    while l<n:
        m1*=m1
        l*=2
    n-=l
    m2*=m1
    if m2>1000000007:
        m2//=1000000007
print(m2)

Fixed, accepted submission:
# your code goes here
m,n=(int(i) for i in input().split())
m2=1
while n>0:
    m1=m
    l=1
    while l*2<=n:
        m1*=m1
        if m1>1000000007:
            m1%=1000000007
 #       print(m1)
        l*=2
    n-=l
    m2*=m1
    if m2>1000000007:
        m2%=1000000007
#    print(m2)
print(m2)
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):
a=int(input())
print(a % 1000)

Fixed, accepted submission:
a=int(input())
b=a % 1000
if b>>0:
  print(1000-b)
else:
  print(0)
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())
a = 0
w = 0
t = 0
r = 0
for i in range(N):
  S=input();
  if S[0] == "A":
    a+=1
  elif S[0] == "W":
    w+=1
  elif S[0] == "T":
    t+=1
  else:
    r+=1
print("AC x",a)
print("WC x",w)
print("TLE x",t)
print("RE x",r)



Fixed, accepted submission:
N=int(input())
a = 0
w = 0
t = 0
r = 0
for i in range(N):
  S=input();
  if S[0] == "A":
    a+=1
  elif S[0] == "W":
    w+=1
  elif S[0] == "T":
    t+=1
  else:
    r+=1
print("AC x",a)
print("WA x",w)
print("TLE x",t)
print("RE x",r)
Problem:
You are given an integer N. Build an undirected graph with N vertices with indices 1 to N that satisfies the following two conditions:    * The graph is simple and connected.   * There exists an integer S such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is S.  It can be proved that at least one such graph exists under the constraints of this problem.

Incorrect submission (verdict: Wrong Answer):
# input
n = int(input())

# 1. make validate graph fragment (all index are includede completely)
fragments = []
if n % 2 == 0:
    
    fragments = [(i + 1, n - i) for i in range(n // 2)]
else:
    
    fragments = [(i + 1, n - i - 1) for i in range(n // 2)]
    fragments.append((n,))

# 2. each vertex connect all vertex excepy for one's belonging graph's element
edges = []
for i, frag in enumerate(fragments):
    for vtx in frag:
        other_frags = fragments[:i] + fragments[i + 1:]
        edges.extend([(vtx, o_vtx) for o_frag in other_frags for o_vtx in o_frag])


for edge in edges:
    if edge[0] > edge[1]:
        del edge


print(len(edges))
for edge in edges:
    print(' '.join(str(i) for i in edge))


Fixed, accepted submission:
# input
n = int(input())

# 1. make validate graph fragment (all index are includede completely)
fragments = []
if n % 2 == 0:
    
    fragments = [(i + 1, n - i) for i in range(n // 2)]
else:
    
    fragments = [(i + 1, n - i - 1) for i in range(n // 2)]
    fragments.append((n,))

# 2. each vertex connect all vertex excepy for one's belonging graph's element
edges = []
for i, frag in enumerate(fragments):
    for vtx in frag:
        other_frags = fragments[:i] + fragments[i + 1:]
        edges.extend([(vtx, o_vtx) for o_frag in other_frags for o_vtx in o_frag])


for edge in edges[:]:
    if edge[0] > edge[1]:
        edges.remove(edge)


print(len(edges))
for edge in edges:
    print(' '.join(str(i) for i in edge))
Problem:
標準録画で 120 分のビデオテープがあります。テープを完全に巻き戻した状態でビデオデッキのカウンタを 00:00:00 にし、標準録画モードで録画したところ、あるカウンタ値になりました。このカウンタ値（時、分、秒）を入力し、残りのテープの長さ（録画可能時間）を求め、時：分：秒の形式で出力するプログラムを作成して下さい。  ただし、2 時間（120分）以内の入力とします。なお、テープ残量は標準録画モードと 3 倍録画モードの場合の２通りを計算し、出力例のように時、分、秒とも 2 桁ずつ出力します。また "05" のように 10 の位が 0 の場合は、"0" をつけてください。

Incorrect submission (verdict: Wrong Answer):
while 1:
 t,h,s=map(int,input().split())
 if t<0:break
 d,e=7200,t*3600+h*60+s
 a,b=d-e,d-e/3
 print(f'{a//3600:02}:{a//60%60:02}:{a%60:02}')
 print(f'{b//3600:02}:{b//60%60:02}:{b%60:02}')


Fixed, accepted submission:
p=lambda x:print(f'{x//3600:02}:{x//60%60:02}:{x%60:02}')
for e in iter(input,'-1 -1 -1'):
 h,m,s=map(int,e.split())
 d=7200-h*3600-m*60-s
 p(d);p(d*3)
Problem:
You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.  For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.  Assume that initially no person lives in the building.

Incorrect submission (verdict: Wrong Answer):
import sys
n = int(input())
list_room = [0 for i in range(120)]

for i in range(n):
	b, f, r, v = map(int, input().split())
	room = ((b-1)*3+(f-1))*10 + r-1
	list_room[room] += v

#print(list_room)

for i in range(4):
	for j in range(3):
		line = ""
		for k in range(10):
			line += " "+str(list_room[i*30 + j*10 + k])			
		print(line)
		
	print("#"*20)

	

Fixed, accepted submission:
import sys
n = int(input())
list_room = [0 for i in range(120)]

for i in range(n):
	b, f, r, v = map(int, input().split())
	room = ((b-1)*3+(f-1))*10 + r-1
	list_room[room] += v

#print(list_room)

for i in range(4):
	for j in range(3):
		line = ""
		for k in range(10):
			line += " "+str(list_room[i*30 + j*10 + k])			
		print(line)
	if i != 3:	
		print("#"*20)
Problem:
AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number.

Incorrect submission (verdict: Wrong Answer):
a = int("".join(list(input().split())))
print("YES" if (int(a**.5))**2 == a else "NO")

Fixed, accepted submission:
a = int("".join(list(input().split())))
print("Yes" if (int(a**.5))**2 == a else "No")
Problem:
An elementary school student Takahashi has come to a variety store.  He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it?  Note that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan.

Incorrect submission (verdict: Wrong Answer):
A,B,C=map(int,input().split())
if A+B>=C:
  print('No')
else:
  print('Yes')

Fixed, accepted submission:
A,B,C=map(int,input().split())
if A+B>=C:
  print('Yes')
elif A+B<=C:
  print('No')
Problem:
Snuke has a favorite restaurant.  The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.  So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen. Find x-y.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
print(n*800-40*n//3)

Fixed, accepted submission:
n=int(input())
print(n*800-200*(n//15))
Problem:
Snuke loves working out. He is now exercising N times.  Before he starts exercising, his _power_ is 1. After he exercises for the i-th time, his power gets multiplied by i.  Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
p=1
for i in range(1,n+1):
    p=p*i
    p=p%(10**9+7)

Fixed, accepted submission:
n=int(input())
p=1
for i in range(1,n+1):
    p=p*i
    p=p%(10**9+7)
print(p)
Problem:
We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not.  You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by deleting one or more characters from the end of S. It is guaranteed that such a non-empty string exists for a given input.

Incorrect submission (verdict: Wrong Answer):
s = input()
for i in range(1, len(s), 2):
    a = s[:-i]
    if a[:len(a)//2]==a[len(a)//2:]:
        print(len(a))
        exit()

Fixed, accepted submission:
s = input()
for i in range(2, len(s), 2):
    a = s[:-i]
    if a[:len(a)//2]==a[len(a)//2:]:
        print(len(a))
        exit()
Problem:
We ask you to select some number of positive integers, and calculate the sum of them.  It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.  Your objective is to make the sum congruent to C modulo B. Determine whether this is possible.  If the objective is achievable, print `YES`. Otherwise, print `NO`.

Incorrect submission (verdict: Wrong Answer):
A, B, C = map(int, input().split())
for i in range(1, 1000):
    if B*i%A==0:
        count=1
    else:
        count=0
print("No" if count==0 else "Yes")

Fixed, accepted submission:
A, B, C = map(int, input().split())
for i in range(1, 10000):
    if ((B*i)+C)%A==0:
        count=1
        break
    else:
        count=0
print("YES" if count==1 else "NO")