TnT/CodeNet4Repair huggingface dataset:
Problem:
It is September 9 in Japan now.  You are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N?

Incorrect submission (verdict: Wrong Answer):
X = str(input())

if '9' in X:
    print('YES')
else:
    print('NO')


Fixed, accepted submission:
X = str(input())

if '9' in X:
    print('Yes')
else:
    print('No')
Problem:
Let N be a positive integer.  There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements in the first half of a') - (the sum of the elements in the second half of a').  Find the maximum possible score of a'.

Incorrect submission (verdict: Wrong Answer):
import heapq
n = int(input())
a = list(map(int, input().split()))

a1 = a[:n]
ax = a[n:2*n]
a2 = list(map(lambda x: -x, a[2*n:]))
print('a2', a2)

sum_a1 = sum(a1)
fdif1 = [sum_a1]
heapq.heapify(a1)
for i in range(n):
    p = heapq.heappushpop(a1,ax[i])
    fdif1.append(fdif1[-1]+ax[i]-p)
    
sum_a2 = sum(a2)
fdif2 = [sum_a2]
heapq.heapify(a2)
print('a2', a2)
for i in range(n):
    p = heapq.heappushpop(a2,-ax[-1-i])
    fdif2.append(fdif2[-1]-ax[-1-i]-p)
fdif2.reverse()

fdif = [fdif1[i]+fdif2[i] for i in range(n)]
print(max(fdif))

Fixed, accepted submission:
import heapq
n = int(input())
a = list(map(int, input().split()))

a1 = a[:n]
ax = a[n:2*n]
a2 = list(map(lambda x: -x, a[2*n:]))
#print('a2', a2)

sum_a1 = sum(a1)
fdif1 = [sum_a1]
heapq.heapify(a1)
for i in range(n):
    p = heapq.heappushpop(a1,ax[i])
    fdif1.append(fdif1[-1]+ax[i]-p)
    
sum_a2 = sum(a2)
fdif2 = [sum_a2]
heapq.heapify(a2)
#print('a2', a2)
for i in range(n):
    p = heapq.heappushpop(a2,-ax[-1-i])
    fdif2.append(fdif2[-1]-ax[-1-i]-p)
fdif2.reverse()

fdif = [fdif1[i]+fdif2[i] for i in range(n+1)]
print(max(fdif))
Problem:
You are given a string S.  Takahashi can insert the character `A` at any position in this string any number of times.  Can he change S into `AKIHABARA`?

Incorrect submission (verdict: Wrong Answer):
def main():
    s = str(input())
    t = 'AKIHABARA'
    i = 0
    j = 0

    while i < len(t) and j < len(s):
        if t[i] == s[j]:
            i += 1
            j += 1
        else:
            i += 1

    print('YES' if j == len(s) - 1 else 'NO')


if __name__ == '__main__':
    main()


Fixed, accepted submission:
def main():
    import re

    f = re.match('A?KIHA?BA?RA?$',input())
    print('YES'if f else 'NO')


if __name__ == '__main__':
    main()
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):
def getNum():
    x,y,z = map(int,input().split())
    return x,y,z

def cal(x,y,z):
    tmp = x / y / z
    if tmp < x:
        print(tmp)
    else:
        print(tmp - 1)

def main():
    x,y,z = getNum()
    cal(x,y,z)

main()

Fixed, accepted submission:
def getNum():
    x,y,z = map(int,input().split())
    return x,y,z

def cal(x,y,z):
    num = int((x-z) / (y+z))
    print(num)

def main():
    x,y,z = getNum()
    cal(x,y,z)

main()
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("Yes")
else:
    print("No")


Fixed, accepted submission:
A, B, C = map(int, input().split())
if A + B >= C:
    print("Yes")
else:
    print("No")
Problem:
Does \sqrt{a} + \sqrt{b} < \sqrt{c} hold?

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

ans = False

if c-a-b >= 0 and a*b < (c-a-b)**2:
  ans = True


print('Yes' if ans else 'No')


Fixed, accepted submission:
a,b,c = map(int, input().split())
 
ans = False
 
if c-a-b >= 0 and 4*a*b < (c-a-b)**2:
  ans = True
 
 
print('Yes' if ans else 'No')
Problem:
Takahashi and Aoki are training for long-distance races in an infinitely long straight course running from west to east.  They start simultaneously at the same point and moves as follows **towards the east** :    * Takahashi runs A_1 meters per minute for the first T_1 minutes, then runs at A_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.   * Aoki runs B_1 meters per minute for the first T_1 minutes, then runs at B_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.  How many times will Takahashi and Aoki meet each other, that is, come to the same point? We do not count the start of the run. If they meet infinitely many times, report that fact.

Incorrect submission (verdict: Wrong Answer):
t1,t2 = map(int,input().split())
a1,a2 = map(int,input().split())
b1,b2 = map(int,input().split())
if a1*t1+a2*t2>=b1*t1+b2*t2:
    a1,a2,b1,b2 = b1,b2,a1,a2
d = b1*t1+b2*t2 - (a1*t1+a2*t2)
print(d)
if d == 0:
    print('inifinity')

elif a1*t1<b1*t1:
    print(0)
else:
    if (a1*t1 - b1*t1)*2%d ==0:
        print(((a1*t1 - b1*t1)*2+d-1)//d)
    else:
        print((a1*t1 - b1*t1)//d*2+1)


Fixed, accepted submission:
t1,t2 = map(int,input().split())
a1,a2 = map(int,input().split())
b1,b2 = map(int,input().split())
if a1*t1+a2*t2>=b1*t1+b2*t2:
    a1,a2,b1,b2 = b1,b2,a1,a2
d = b1*t1+b2*t2 - (a1*t1+a2*t2)
if d == 0:
    print('infinity')

elif a1*t1<b1*t1:
    print(0)
else:
    if (a1*t1 - b1*t1)*2%d ==0:
        print(((a1*t1 - b1*t1)*2+d-1)//d)
    else:
        print((a1*t1 - b1*t1)//d*2+1)
Problem:
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.  Determine if it is possible that there are exactly X cats among these A + B animals.

Incorrect submission (verdict: Wrong Answer):
a, b, x = list(map(int, input().split()))
if a >= x and x - a <= b:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
a, b, x = list(map(int, input().split()))
if a <= x and x - a <= b:
    print('YES')
else:
    print('NO')
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())
print(n%1000)

Fixed, accepted submission:
n=int(input())
print(1000-n%1000 if n%1000!=0 else 0)
Problem:
Mr. Takahashi has a string s consisting of lowercase English letters. He repeats the following operation on s exactly K times.    * Choose an arbitrary letter on s and change that letter to the next alphabet. Note that the next letter of `z` is `a`.  For example, if you perform an operation for the second letter on `aaz`, `aaz` becomes `abz`. If you then perform an operation for the third letter on `abz`, `abz` becomes `aba`.  Mr. Takahashi wants to have the lexicographically smallest string after performing exactly K operations on s. Find the such string.

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

a = [0] * len(s)
for i in range(len(s)):
  a[i] =  ((ord('z') - ord(s[i])) + 1)%26
  if a[i] == 0:
    pass
  elif K - a[i] >= 0:
    K -= a[i]
    a[i] = 0
for i in range(len(s)-1):
  print(chr((26-a[i])%26+ord('a')), end = '')

b = ord('a') + (ord(s[-1])-ord('a') + K)%26
print( chr( b ) ) 
  


Fixed, accepted submission:
s = input()
K = int(input())

a = [0] * len(s)
for i in range(len(s) - 1):
  a[i] =  ((ord('z') - ord(s[i])) + 1)%26
  if a[i] == 0:
    pass
  elif K - a[i] >= 0:
    K -= a[i]
    a[i] = 0

for i in range(len(s)-1):
  print(chr((26-a[i])%26+ord('a')), end = '')

if K != 0:
  b = ord('a') + (ord(s[-1])-ord('a') + K)%26
  print( chr( b ) ) 
else:
  print(s[-1])
Problem:
AtCoDeer has three cards, one red, one green and one blue.   An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card.   We will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer.   Is this integer a multiple of 4?

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

answer = r*100 + g*10 + b

if answer % 4 == 0:
    print("Yes")
else:
    print("No")


Fixed, accepted submission:
r, g, b = map(int,input().split())

answer = r*100 + g*10 + b

if answer % 4 == 0:
    print("YES")
else:
    print("NO")
Problem:
Write a program which reads two integers a and b, and calculates the following values:    * a ÷ b: d (in integer)   * remainder of a ÷ b: r (in integer)   * a ÷ b: f (in real number)

Incorrect submission (verdict: Wrong Answer):
numbers = [int(x) for x in input().split(" ")]
a, b = numbers[0], numbers[1]
print("{} {} {}".format((a//b), (a%b), (a/b)))

Fixed, accepted submission:
numbers = [int(x) for x in input().split(" ")]
a, b = numbers[0], numbers[1]
print("{} {} {:.5f}".format((a//b), (a%b), (a/b)))
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):
x, y, z = map(int, input().split())
x -= z
r = x / (y+z)
print(r)

Fixed, accepted submission:
x, y, z = map(int, input().split())
x -= z
r = x / (y+z)
print(int(r))
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())

ans = 0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        ans += int(x)
    else:
        ans += int(float(x) * 380000 + 0.1)

print(ans)



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

ans = 0
for i in range(n):
    x, u = input().split()
    if u == "JPY":
        ans += int(x)
    else:
        ans += float(x) * 380000

print(ans)
Problem:
In the beginning, Takahashi has A cookies, and Aoki has B cookies. They will perform the following operation alternately, starting from Takahashi:    * If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person.  Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.

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

Fixed, accepted submission:
a,b,k = map(int,input().split())
bit = 0
while k:
  if bit==0:
    if a%2!=0:
      a -= 1
    b += a//2
    a //= 2
    bit = 1
  else:
    if b%2!=0:
      b -= 1
    a += b//2
    b //= 2
    bit = 0
  k -= 1


print(a,b)
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())

maxnum = 2

for i in range(8):
  if maxnum > n:
    print(maxnum/2)
    break
  maxnum*=2

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

maxnum = 2

for i in range(8):
    if maxnum > n:
        print(int(maxnum/2))
        break
    maxnum*=2
Problem:
There are N integers a_1, a_2, ..., a_N not less than 1. The values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \times a_2 \times ... \times a_N = P.  Find the maximum possible greatest common divisor of a_1, a_2, ..., a_N.

Incorrect submission (verdict: Wrong Answer):
N, P = map(int,input().split())
n, p = N, P

if(N == 1 or P == 1):
  print(P)
  exit()

num = []
s = 0
while s == 0:
  for i in range(2,p+1):
    if(p%i == 0):
      p = int(p/i)
      if(p == 1):
        s = 1
      num.append(i)
      break
d = {}
cnt = 1
for i in num:
  d[i] = num.count(i)
for k, v in d.items():
  if(v >= n):
    cnt *= k ** (v//n)
    print(k,v)
print(cnt)

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

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)
Problem:
Two students of AtCoder Kindergarten are fighting over candy packs.  There are three candy packs, each of which contains a, b, and c candies, respectively.  Teacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible.  Note that Evi cannot take candies out of the packs, and the whole contents of each pack must be given to one of the students.

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

A = [a,b,c]
A.sort()
if A[0] == (A[1]+A[2]) or (A[0] + A[1]) == A[2]:
    print('YES')
else:
    print('NO')


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

A = [a,b,c]
A.sort()
if A[0] == (A[1]+A[2]) or (A[0] + A[1]) == A[2]:
    print('Yes')
else:
    print('No')
Problem:
_n_ _q_   _name 1 time1_   _name 2 time2_   ...   _name n timen_    In the first line the number of processes _n_ and the quantum _q_ are given separated by a single space.  In the following _n_ lines, names and times for the _n_ processes are given. _name i_ and _time i_ are separated by a single space.

Incorrect submission (verdict: Wrong Answer):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 14:42:43 2018

@author: maezawa
"""

def print_array(g):
    ans = str(g[0])
    if len(g) > 1:
        for i in range(1,len(g)):
            ans += ' '+str(g[i]) 
    print(ans)

name=[]
time=[]
n, q = list(map(int, input().split()))
for i in range(n):
    s = input().split()
    name.append(s[0])
    time.append(int(s[1]))
# =============================================================================
# print(n,q)
# print(name)
# print(time)
# =============================================================================
finished = []
i=0
remain = n
while True:
    if time[i] == 0:
        i += 1
        if i == n:
            i = 0
        continue
    if time[i] <= q:
        finished.append(name[i])
        time[i] = 0
        remain -= 1
        if remain == 0:
            break
    else:
        time[i] -= q
        i += 1
        if i == n:
            i = 0

print_array(finished)
        


Fixed, accepted submission:
# -*- coding: utf-8 -*-


def fifo_enque(data):
    global tail
    global fifo
    fifo[tail] = data
    tail = (tail+1)%fifo_size
    
def fifo_deque():
    global head
    global fifo
    data = fifo[head]
    head = (head+1)%fifo_size
    return data

fifo_size = 100000
fifo = [0 for _ in range(fifo_size)]
head = 0
tail = 0

n, q = list(map(int, input().split()))
for i in range(n):
    s = input().split()
    data = [s[0], int(s[1])]
    fifo_enque(data)
    
current_time = 0
finished = []
fin_time = []

while True:
    data = fifo_deque()
    if data[1] > q:
        current_time += q
        data[1] -= q
        fifo_enque(data)
    else:
        current_time += data[1]
        finished.append(data[0])
        fin_time.append(current_time)
    if head == tail:
        break

for i in range(n):
    print("{} {}".format(finished[i], fin_time[i]))
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):
A=input().split()
print(A)
if A==["5","5","7"] or ["5","7","5"] or ["7","5","5"]:
  print("YES")
else:
  print("NO")

Fixed, accepted submission:
A=input().split()
if A==["5","5","7"] or A==["5","7","5"] or A==["7","5","5"]:
  print("YES")
else:
  print("NO")
Problem:
We held two competitions: Coding Contest and Robot Maneuver.  In each competition, the contestants taking the 3-rd, 2-nd, and 1-st places receive 100000, 200000, and 300000 yen (the currency of Japan), respectively. Furthermore, a contestant taking the first place in both competitions receives an additional 400000 yen.  DISCO-Kun took the X-th place in Coding Contest and the Y-th place in Robot Maneuver. Find the total amount of money he earned.

Incorrect submission (verdict: Wrong Answer):
import math
N = 1
x, y = [0]*N, [0]*N
l = list(range(N))
sum=0
#print(x[0])

for i in range(N):
  x[i], y[i] = map(int, input().split())

if x[0] <= 3:
   sum=sum+10000*(4-x[0])
else:
    pass

if y[0]<= 3:
   sum=sum+10000*(4-y[0])
else:
    pass

if x[0]==1 and y[0]==1:
    sum=sum+40000

else:
    pass

print(sum)


Fixed, accepted submission:
# -*- Coding: utf-8 -*-
import itertools
import math
N = 1
x, y = [0]*N, [0]*N
l = list(range(N))
sum=0
#print(x[0])

for i in range(N):
  x[i], y[i] = map(int, input().split())

if x[0] <= 3:
   sum=sum+100000*(4-x[0])
else:
    pass

if y[0]<= 3:
   sum=sum+100000*(4-y[0])
else:
    pass

if x[0]==1 and y[0]==1:
    sum=sum+400000

else:
    pass

print(sum)
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):
# coding: utf-8
# Your code here!
S = input()
while True:
    if len(S)!=0:
        if S[len(S)-7:len(S)]=="dreamer":
            S = S.rstrip("dreamer")
        elif S[len(S)-6:len(S)]=="eraser":
            S = S.rstrip("eraser")
        elif S[len(S)-5:len(S)]=="dream":
            S = S.rstrip("dream")
        elif S[len(S)-5:len(S)]=="erase":
            S = S.rstrip("erase")
        else:
            print("NO")
            break
    else:
        print("YES")
        break


Fixed, accepted submission:
# coding: utf-8
# Your code here!
S = input()
while True:
    if len(S)!=0:
        if S[len(S)-7:len(S)]=="dreamer":
            S = S[0:len(S)-7]
        elif S[len(S)-6:len(S)]=="eraser":
            S = S[0:len(S)-6]
        elif S[len(S)-5:len(S)]=="dream":
            S = S[0:len(S)-5]
        elif S[len(S)-5:len(S)]=="erase":
            S = S[0:len(S)-5]
        else:
            print("NO")
            break

    else:
        print("YES")
        break
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):
line = input()

if line == '5 5 7' or line == '7 5 5':
  print('Yes')
  
else:
  print('No')

Fixed, accepted submission:
line = input()

if line == '5 5 7' or line == '5 7 5' or line == '7 5 5':
    print('YES')
else:
    print('NO')
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())
while(N>1000):
  N -= 1000
print(str(N))

Fixed, accepted submission:
N = int(input())
for i in range(20):
  if(N <= 1000):
    break
  N -= 1000
print(str(1000-N))
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())

ans1 = int(A*X + B*Y)
ans2 = int(C*X + (Y-X)*B)
ans3 = int(C*Y + (X-Y)*A)

print(min(ans1,ans2,ans3))

Fixed, accepted submission:
A,B,C,X,Y=map(int,input().split())

ans1 = int(A*X + B*Y)
if X<=Y:
  ans2 = int(C*2*X + (Y-X)*B)
  ans3 = 10**10
  ans4 = int(2*Y*C)
else:
  ans2 = 10**10
  ans3 = int(C*2*Y + (X-Y)*A)
  ans4 = int(2*X*C)
  
  
print(min(ans1,ans2,ans3,ans4))
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,b+1):
         if (a * i) % b == c:
                  print("Yes")
                  exit()
print("No")


Fixed, accepted submission:
a,b,c = map(int,input().split())
for i in range(1,b+1):
         if (a * i) % b == c:
                  print("YES")
                  exit()
print("NO")
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=input()

if 8 <= 15 - len(s) + s.count("o"):
    print("Yes")
else:
    print("No")

Fixed, accepted submission:
s=input()

if 8 <= 15 - len(s) + s.count("o"):
    print("YES")
else:
    print("NO")