ZhenlongDai/ACPR huggingface dataset:
Problem: p04017
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

from bisect import bisect

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

m = 20
par = [[-1]*n for i in range(m)]

for i in range(n):
    j = bisect(x, x[i]+l)-1
    par[0][i] = j

for i in range(m-1):
    for j in range(n):
        par[i+1][j]=par[i][par[i][j]]

def hoge(x, y):
    k = 0
    for i in range(m)[::-1]:
        if par[i][x] < y:
            k += 1<<i
            x = par[i][x]
        elif i == 0 and par[i][x] >= y:
            k += 1<<i
    return k

q = int(input())
ans = []
for i in range(q):
    a,b = map(int, input().split())
    a,b = a-1,b-1
    if a > b:
        a,b = b,a
    ans.append(hoge(a, b))

print(*ans, sep="\n")

Failing test case input:
9
1 3 6 13 23 18 19 29 31
12
2
1 3
1 5
9 7
8 1

Expected output:
1
2


Actual output:
1
1


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

from bisect import bisect

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

m = 20
par = [[-1]*n for i in range(m)]

for i in range(n):
    j = bisect(x, x[i]+l)-1
    par[0][i] = j

for i in range(m-1):
    for j in range(n):
        par[i+1][j]=par[i][par[i][j]]

def hoge(x, y):
    k = 0
    for i in range(m)[::-1]:
        if par[i][x] < y:
            k += 1<<i
            x = par[i][x]
    return k+1

q = int(input())
ans = []
for i in range(q):
    a,b = map(int, input().split())
    a,b = a-1,b-1
    if a > b:
        a,b = b,a
    print(hoge(a,b))

Problem: p04017
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from bisect import bisect_right
N = int(input())
X = list(map(int, input().split()))
L = int(input())

P = [[0] * N for i in range(30)]
for i in range(N):
    q = bisect_right(X, X[i] + L)
    P[0][i] = q - 1

for i in range(1, 30):
    for j in range(N):
        P[i][j] = P[i - 1][P[i - 1][j]]

Q = int(input())
for i in range(Q):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    if a > b:
        a, b = b, a
    Y = X[b]
    num = 0
    for j in range(29, -1, -1):
        if X[P[j][a]] <= Y:
            Y -= X[P[j][a]]
            num += 2 ** j
        if Y <= 0:
            print(num)
            break

Failing test case input:
9
1 3 0 13 23 18 19 29 58
10
2
1 2
7 5
6 7
8 5

Expected output:
1
1


Actual output:

Fixed submission (verdict: Accepted):
from bisect import bisect_right
N = int(input())
X = list(map(int, input().split()))
L = int(input())

P = [[0] * N for i in range(30)]
for i in range(N):
    q = bisect_right(X, X[i] + L)
    P[0][i] = q - 1

for i in range(1, 30):
    for j in range(N):
        P[i][j] = P[i - 1][P[i - 1][j]]


Q = int(input())
for i in range(Q):
    a, b = map(int, input().split())
    if a > b:
        a, b = b, a
    a, b = a - 1, b - 1
    num = 0
    for j in range(29, -1, -1):
        if P[j][a] < b:
            a = P[j][a]
            num += 2 ** j
    print(num + 1)
Problem: p04017
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from bisect import bisect_right
N = int(input())
X = list(map(int, input().split()))
L = int(input())

P = [[0] * N for i in range(30)]
for i in range(N):
    q = bisect_right(X, X[i] + L)
    P[0][i] = q - 1

for i in range(1, 30):
    for j in range(N):
        P[i][j] = P[i - 1][P[i - 1][j]]


Q = int(input())
for i in range(Q):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    if a > b:
        a, b = b, a
    Y = X[b]
    num = 0
    for j in range(29, 0, -1):
        if X[P[j][a]] <= Y:
            Y = X[P[j][a]]
            num += 2 ** (j - 1)
    print(num + 1)


Failing test case input:
9
1 3 6 13 23 18 19 29 31
10
2
1 9
7 2
10 2
8 10

Expected output:
5
2


Actual output:
536870912
2


Fixed submission (verdict: Accepted):
from bisect import bisect_right
N = int(input())
X = list(map(int, input().split()))
L = int(input())

P = [[0] * N for i in range(30)]
for i in range(N):
    q = bisect_right(X, X[i] + L)
    P[0][i] = q - 1

for i in range(1, 30):
    for j in range(N):
        P[i][j] = P[i - 1][P[i - 1][j]]


Q = int(input())
for i in range(Q):
    a, b = map(int, input().split())
    if a > b:
        a, b = b, a
    a, b = a - 1, b - 1
    num = 0
    for j in range(29, -1, -1):
        if P[j][a] < b:
            a = P[j][a]
            num += 2 ** j
    print(num + 1)
Problem: p03480
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()

n = len(S)
a = n
for i in range(n-1):
    if S[i] != S[i+1]:
        a = min(a, max(i+1, n-i+1))

print(a)


Failing test case input:
11010111

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
S = input()

n = len(S)
a = n
for i in range(n-1):
    if S[i] != S[i+1]:
        a = min(a, max(i+1, n-i-1))

print(a)

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

N = len(S)
L = []
temp = S[0]
c = 1
for i in range(1, N-1):
    if S[i] == temp:
        c += 1
    else:
        L.append(c)
        c = 1
        temp = S[i]
if S[N-1] == temp:
    c += 1
else:
    L.append(c)
    c = 1
L.append(c)

ans = N
while len(L) >= 3:
    if L[0] > L[-1]:
        ans = min(ans, N-L[-1])
        L[1] += L[0]
        L.pop(0)
    else:
        ans = min(ans, N-L[0])
        L[-2] += L[-1]
        L.pop(-1)
        
if len(L) == 2:
    ans = min(ans, max(L))
    
print(ans)

Failing test case input:
100010011

Expected output:
5


Actual output:
8


Fixed submission (verdict: Accepted):
S = input()

N = len(S)
L = []
temp = S[0]
c = 1
for i in range(1, N-1):
    if S[i] == temp:
        c += 1
    else:
        L.append(c)
        c = 1
        temp = S[i]
if S[N-1] == temp:
    c += 1
else:
    L.append(c)
    c = 1
L.append(c)

ans = N
while len(L) >= 3:
    if L[0] > L[-1]:
        ans = min(ans, N-L[-1])
        L[-2] += L[-1]
        L.pop(-1)
    else:
        ans = min(ans, N-L[0])
        L[1] += L[0]
        L.pop(0)
        
if len(L) == 2:
    ans = min(ans, max(L))
    
print(ans)

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import groupby

S = list(input())
n = len(S)
s = [len(list(j)) for i, j in groupby(S)]
s = [max(i, n - i) for i in s]

print(min(s))


Failing test case input:
010000110

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
from itertools import groupby, accumulate

S = list(input())
n = len(S)
s = list(accumulate([len(list(j)) for i, j in groupby(S)]))
s = [max(i, n - i) for i in s]

print(min(s))

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
n = len(S)
T = 1000000
for i in range(1, n) :
    if S[i] != S[i-1] :
        T = min(T, max(i, n-i))
print(T if T != 0 else n)


Failing test case input:
000000000

Expected output:
9


Actual output:
1000000


Fixed submission (verdict: Accepted):
S = input()
n = len(S)
T = n
for i in range(1, n) :
    if S[i] != S[i-1] :
        T = min(T, max(i, n-i))
print(T)
Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
INF = float("inf")


def solve(S: str):

    if int(S) == 0:
        print(len(S))
        return

    N = len(S)
    ts = INF
    for i, c in enumerate(S):
        if i == 0:
            continue
        if S[i-1] != S[i]:
            ts = min(ts, max(i, N-i))
    print(ts)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  
    solve(S)


if __name__ == '__main__':
    main()


Failing test case input:
11111111

Expected output:
8


Actual output:
inf


Fixed submission (verdict: Accepted):

import sys
INF = float("inf")


def solve(S: str):

    N = len(S)
    ts = N
    for i in range(1, N):
        if S[i] != S[i-1]:
            ts = min(ts, max(i, N-i))
    print(ts)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  
    solve(S)


if __name__ == '__main__':
    main()

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input();n=len(s);print(min([max(i,n-i)for i in range(1,n)if s[i-1]!=s[i]]or[0]))

Failing test case input:
000000000

Expected output:
9


Actual output:
0


Fixed submission (verdict: Accepted):
s=input();n=len(s);print(min([max(i,n-i)for i in range(1,n)if s[i-1]!=s[i]]or[n]))

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__=="__main__":
    l = list(input())
    N = len(l)
    results = [1]
    for i in range(0,N-1):
        if not l[i]==l[i+1]:
            results.append(max(i+1,N-i-1))
    print(min(results))

Failing test case input:
010110010

Expected output:
5


Actual output:
1


Fixed submission (verdict: Accepted):
if __name__=="__main__":
    l = list(input())
    N = len(l)
    results = []
    for i in range(0,N-1):
        if not l[i]==l[i+1]:
            results.append(max(i+1,N-i-1))
    if len(results):
        print(min(results))
    else:
        print(N)

Problem: p03480
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
j = 0
m = S[0]
ls = []
for i in range(len(S)):
  if m!=S[i]:
    ls += [i-j]
    j = i
    m = S[i]
ls += [len(S)-j]
if len(ls)<3:
  print(max(ls))
else:
  ans = 0
  for i in range(0,len(ls)-2):
    m = min(ls[i]+ls[i+1],ls[i+1]+ls[i+2])
    ans = max(ans,m)
  print(ans)

Failing test case input:
010010100

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
S = input()
j = 0
m = S[0]
ls = []
for i in range(len(S)):
  if m!=S[i]:
    ls += [i-j]
    j = i
    m = S[i]
ls += [len(S)-j]
N = len(ls)
if N<3:
  print(max(ls))
else:
  ans = float('inf')
  sls = [ls[0]]
  for i in range(1,N):
    sls += [sls[-1]+ls[i]]
  for i in range(N-1):
    ans = min(ans,max(sls[i], sls[-1]-sls[i]))
  print(ans)
Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



S = list(map(int, input()))




















N = len(S)

if sum(S) < 1:
    min_T = 0
else:
    min_T = N
    for i in range(1, N):
        if S[i]!=S[i-1]:
            min_T = min(min_T, max(i, N-i))

print(min_T)





Failing test case input:
000000000

Expected output:
9


Actual output:
0


Fixed submission (verdict: Accepted):



S = list(map(int, input()))




















N = len(S)


min_T = N
for i in range(1, N):
    if S[i]!=S[i-1]:
        min_T = min(min_T, max(i, N-i))

print(min_T)

Problem: p03480
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import heapq
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

S = str(input())
N = len(S)
ans = int(0)

k = N

for i in range(N-1):
    if S[i]!=S[i+1]:
        k = max(i+1,N-1-i)
ans = k
print(ans)

Failing test case input:
101011000

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
import heapq
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

S = str(input())
N = len(S)
ans = int(0)

k = N

for i in range(N-1):
    if S[i]!=S[i+1]:
        k = min(max(i+1,N-1-i),k)
ans = k
print(ans)

Problem: p03480
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
S=input().strip()
t=10**6
for i in range(1,len(S)):
    if S[i-1]!=S[i]:
        t=min(t,max(i,len(S)-i))
if t==0:
    print(len(S))
else:
    print(t)


Failing test case input:
11111111

Expected output:
8


Actual output:
1000000


Fixed submission (verdict: Accepted):

S=input()
t=10**6
for i in range(1,len(S)):
    if S[i-1]!=S[i]:
        t=min(t,max(i,len(S)-i))

if t==10**6:
    print(len(S))
else:
    print(t)

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

s = S[0]
temp_T = 100000
for i in range(1, len(S)):
    if(S[i] != s):
        judge = max(i,len(S)-i)
        temp_T = min(judge, temp_T)
        s = S[i]

print(temp_T)


Failing test case input:
11111111

Expected output:
8


Actual output:
100000


Fixed submission (verdict: Accepted):
S = input()


temp_T = len(S)
for i in range(len(S)-1):
    if(S[i] != S[i+1]):
        judge = max(i+1,len(S)-(i+1))
        temp_T = min(judge, temp_T)

print(temp_T)

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input();l=[]
for i in range(len(s)-1):
 if s[i]!=s[i+1]:l+=[max(i+1,len(s)-i-1)]
print(min(l)if l else 1)

Failing test case input:
11111111

Expected output:
8


Actual output:
1


Fixed submission (verdict: Accepted):
s=input();l=[];n=len(s)
for i in range(n-1):
 if s[i]!=s[i+1]:l+=[max(i+1,n-i-1)]
print(min(l)if l else n)
Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
n=len(s)
ans=-1
for i in range(n-1):
  if s[i+1]!=s[i]:   
    ans=max(ans,max(i,n-i-1))
if ans==-1:
  ans=n
print(ans)

Failing test case input:
100111000

Expected output:
6


Actual output:
8


Fixed submission (verdict: Accepted):
s=input()
n=len(s)
ans=n
for i in range(n-1):
  if s[i+1]!=s[i]:   
    ans=min(ans,max(i+1,n-i-1))
print(ans)
Problem: p03480
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = list(map(int, list(input())))
ans = 10**9
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        ans = min(ans, max(i+1, len(s)-i-1))
print(ans)


Failing test case input:
11111111

Expected output:
8


Actual output:
1000000000


Fixed submission (verdict: Accepted):
s = list(map(int, list(input())))
ans = len(s)
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        ans = min(ans, max(i+1, len(s)-i-1))
print(ans)
Problem: p03480
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
N = len(S)
ans = 10 ** 6
for k in range(N - 1):
    if S[k] != S[k + 1]:
        ans = min(ans, max(k + 1, N - k - 1))
        
if ans != 0:
    print(ans)
else:
    print(N)

Failing test case input:
11111111

Expected output:
8


Actual output:
1000000


Fixed submission (verdict: Accepted):
S = input()
N = len(S)
ans = 10 ** 6
for k in range(N - 1):
    if S[k] != S[k + 1]:
        ans = min(ans, max(k + 1, N - k - 1))
        
if ans != 10 ** 6:
    print(ans)
else:
    print(N)

Problem: p03480
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
n = len(s)
k = 10**9
if not "1" in s:
    print(0)
elif not "0" in s:
    print(n)
else:
    for i in range(n-1):
        if s[i] != s[i+1]:
            k = min(k,max(i+1,n-(i+1)))
    if k > n:
        print(n)
    else:
        print(k)


Failing test case input:
000000000

Expected output:
9


Actual output:
0


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
k = 10**9
if not "1" in s:
    print(n)
elif not "0" in s:
    print(n)
else:
    for i in range(n-1):
        if s[i] != s[i+1]:
            k = min(k,max(i+1,n-(i+1)))
    if k > n:
        print(n)
    else:
        print(k)

Problem: p03480
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import decimal

S = input()

ans = decimal.Decimal("inf")
for i in range(len(S)-1):
    if S[i] != S[i+1]:
        ans = min(ans, max(i, len(S)-i))

print(ans)


Failing test case input:
100000111

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
S = input()

ans = len(S)
for i in range(1, len(S)):
    if S[i-1] != S[i]:
        ans = min(ans, max(i, len(S)-i))

print(ans)
Problem: p03039
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
MOD = 10**9 + 7
list_size = 200001

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

f_r_list[-1] = pow(f_list[-1], MOD - 2, MOD)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)

def comb(n, r):
	if n < r:
		return 0
	elif n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD 

n, m, k = map(int, input().split())
print(int((((n+m)*k*(k-1))/6)*comb(n*m, k)%MOD))

Failing test case input:
111 101 2816

Expected output:
190886879


Actual output:
524220214


Fixed submission (verdict: Accepted):
MOD = 10**9 + 7
list_size = 200001

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

f_r_list[-1] = pow(f_list[-1], MOD - 2, MOD)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)

def comb(n, r):
	if n < r:
		return 0
	elif n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD 

n, m, k = map(int, input().split())
print((((n+m)*n*m*(m*n-1))

Problem: p03039
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M, K = map(int, input().split())

MOD = 10**9+7

def comb(n, r):
    r = n-r if n-r < r else r
    if r == 0:
        return 1
    ndfact = 1
    for i in range(n, n-r, -1):
        ndfact *= i
        ndfact %= MOD
    rfact = 1
    for i in range(r, 1, -1):
        rfact *= i
        rfact %= MOD
    return ndfact 

p = comb(N*M-2, K-2) % MOD
ans = 0
for i in range(N):
    for j in range(M):
        if i == 0 and j == 0:
            continue
        d = i+j
        cnt = (N-i) * (M-j)
        if i != 0 and j != 0:
            cnt *= 2
        ans += d * cnt
        ans %= MOD

print((ans*p)%MOD)


Failing test case input:
101 111 38

Expected output:
745365380


Actual output:
161350482


Fixed submission (verdict: Accepted):
from math import factorial
N, M, K = map(int, input().split())

MOD = 10**9+7

fact = [1] * (N*M+1)
for i in range(2, N*M+1):
    fact[i] = fact[i-1] * i % MOD

def comb(n, r):
    r = n-r if n-r < r else r
    return fact[n] * pow(fact[r], MOD-2, MOD) * pow(fact[n-r], MOD-2, MOD) % MOD

p = comb(N*M-2, K-2)
ans = 0
for i in range(N):
    for j in range(M):
        if i == 0 and j == 0:
            continue
        d = i+j
        cnt = (N-i) * (M-j)
        if i != 0 and j != 0:
            cnt *= 2
        ans += d * cnt % MOD
ans = ans * p % MOD

print(ans)
Problem: p03039
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


def modCombi(n, r):
    global MOD
    return (modFacts[n] * invs[n - r] * invs[r]) % MOD


N, M, K = map(int, input().split())
modFacts, invs = prepare(N * M)
var = modCombi(N * M - 2, K - 2)

ans = 0
if N < M:
    N, M = M, N
L = [0] * (N + 1)
for i in range(1, N + 1):
    L[i] = L[i - 1] + i
for x in range(1, N + 1):
    Sx = (M * (L[N - x] + L[x - 1])) % MOD
    Sy = (N * (L[M - x] + L[x - 1])) % MOD
    ans += ((Sx + Sy) * M) % MOD

print((ans * invs[2] * var) % MOD)



Failing test case input:
100 111 3

Expected output:
25289126


Actual output:
343089299


Fixed submission (verdict: Accepted):
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


def modCombi(n, r):
    global MOD
    return (modFacts[n] * invs[n - r] * invs[r]) % MOD


N, M, K = map(int, input().split())
modFacts, invs = prepare(N * M)
var = modCombi(N * M - 2, K - 2)

ans = 0
if N < M:
    N, M = M, N
L = [0] * (N + 1)
for i in range(1, N + 1):
    L[i] = L[i - 1] + i
for x in range(1, N + 1):
    for y in range(1, M + 1):
        Sx = (M * (L[N - x] + L[x - 1])) % MOD
        Sy = (N * (L[M - y] + L[y - 1])) % MOD
        ans += (Sx + Sy) % MOD

print((ans * invs[2] * var) % MOD)

Problem: p03039
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,k=map(int,input().split())
M=10**9+7
def combi(x,y):
  c=1
  m=min(x-y,y)
  for iii in range(y):
    c=c*(x-iii)*pow(y-iii,-1)%M
  return c

rem_combi=combi(n*m-2,k-2)

def calc(num):
  out=0
  for iii in range(num):
    out+=iii*(num-iii)%M
  return out

x_cost=m*m*calc(n)%M
y_cost=n*n*calc(m)%M
ans=rem_combi*(x_cost+y_cost)%M
print(int(ans))

Failing test case input:
110 101 1145

Expected output:
34756206


Actual output:
102109923


Fixed submission (verdict: Accepted):
n,m,k=map(int,input().split())
M=10**9+7
def combi(x,y):
  c=1
  m=min(x-y,y)
  for iii in range(y):
    c=c*(x-iii)*pow(y-iii,M-2,M)%M
  return c

rem_combi=combi(n*m-2,k-2)

def calc(num):
  out=0
  for iii in range(num):
    out+=iii*(num-iii)%M
  return out

x_cost=m*m*calc(n)%M
y_cost=n*n*calc(m)%M
ans=rem_combi*(x_cost+y_cost)%M
print(int(ans))
Problem: p03039
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,k=map(int,input().split())
mod=10**9+7
f=[1]
for i in range(2*10**5+7):f+=[f[-1]*(i+1)%mod]
def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod
ans=0
for i in range(1,n):
  ans+=(i*(n-i)*m**2)*(comb(n+m-2,k-2))
  ans%=mod
for i in range(1,m):
  ans+=(i*(m-i)*n**2)*(comb(n+m-2,k-2))
  ans%=mod
print(ans)

Failing test case input:
101 111 38

Expected output:
745365380


Actual output:
961797304


Fixed submission (verdict: Accepted):
n,m,k=map(int,input().split())
mod=10**9+7
f=[1]
for i in range(2*10**5+7):f+=[f[-1]*(i+1)%mod]
def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod
ans=0
for i in range(1,n):
  ans+=(i*(n-i)*m**2)*(comb(n*m-2,k-2))
  ans%=mod
for i in range(1,m):
  ans+=(i*(m-i)*n**2)*(comb(n*m-2,k-2))
  ans%=mod
print(ans)

Problem: p03039
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

list=input().split(" ")
n=int(list[0])
m=int(list[1])
k=int(list[2])

niko1=int(m*m*(n*(n+1)*(2*n+1)/6 - (n+1)*n*(n+1)/2 + n*n*(n+1)/2))
niko2=int(n*n*(m*(m+1)*(2*m+1)/6 - (m+1)*m*(m+1)/2 + m*m*(m+1)/2))
niko1=niko1%(10**9+7)
niko2=niko2%(10**9+7)
niko=niko1+niko2
kosu=cmb(m*n-2, k-2)
kosu=kosu%(10**9+7)
kotae=int(niko*kosu/2)
kotae=kotae%(10**9+7)
print(kotae)

Failing test case input:
100 111 681

Expected output:
564141216


Actual output:
564141200


Fixed submission (verdict: Accepted):
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n
 
    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]
 
    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
 
    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])
 
    return result
 
list=input().split(" ")
n=int(list[0])
m=int(list[1])
k=int(list[2])
 
niko1=int((n*(n+1)*(2*n+1)/6 - (n+1)*n*(n+1)/2 + n*n*(n+1)/2)/2)
niko2=int((m*(m+1)*(2*m+1)/6 - (m+1)*m*(m+1)/2 + m*m*(m+1)/2)/2)
niko1=niko1%(10**9+7)
niko2=niko2%(10**9+7)
niko1=niko1*m
niko2=niko2*n
niko1=niko1%(10**9+7)
niko2=niko2%(10**9+7)
niko1=niko1*m
niko2=niko2*n
niko1=niko1%(10**9+7)
niko2=niko2%(10**9+7)
niko=niko1+niko2
kosu=cmb(m*n-2, k-2)
kosu=kosu%(10**9+7)
kotae=int(niko*kosu)
kotae=kotae%(10**9+7)

print(kotae)
Problem: p03039
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import factorial
N, M, K = map(int, input().split())

MOD = 10**9+7

def comb(n, r):
    r = n-r if n-r < r else r
    if r == 0:
        return 1
    ndfact = 1
    for i in range(n, n-r, -1):
        ndfact *= i
        ndfact %= MOD
    return ndfact 

p = comb(N*M-2, K-2) % MOD
ans = 0
for i in range(N):
    for j in range(M):
        if i == 0 and j == 0:
            continue
        d = i+j
        cnt = (N-i) * (M-j)
        if i != 0 and j != 0:
            cnt *= 2
        ans += d * cnt
        ans %= MOD

print((ans*p)%MOD)


Failing test case input:
100 111 619

Expected output:
555736529


Actual output:
38091022


Fixed submission (verdict: Accepted):
from math import factorial
N, M, K = map(int, input().split())

MOD = 10**9+7

fact = [1] * (N*M+1)
for i in range(2, N*M+1):
    fact[i] = fact[i-1] * i % MOD

def comb(n, r):
    r = n-r if n-r < r else r
    return fact[n] * pow(fact[r], MOD-2, MOD) * pow(fact[n-r], MOD-2, MOD) % MOD

p = comb(N*M-2, K-2)
ans = 0
for i in range(N):
    for j in range(M):
        if i == 0 and j == 0:
            continue
        d = i+j
        cnt = (N-i) * (M-j)
        if i != 0 and j != 0:
            cnt *= 2
        ans += d * cnt % MOD
ans = ans * p % MOD

print(ans)

Problem: p03039
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M,K=map(int,input().split())
MOD=10**9+7
ans=0
x,y=1,1
k=min(K-2,N*M-K)
for i in range(k):
    x*=N*M-2-i
    y*=K-2-i
    x%=MOD
    y%=MOD
comb=x*pow(y,MOD-2,MOD)
comb%=MOD
for i in range(1,N):
    a=i*comb*(N-i)*M**2
    ans+=a
    ans%=MOD
for i in range(1,M):
    a=i*comb*(M-i)*N**2
    ans+=a
    ans%=MOD
print(ans%MOD)

Failing test case input:
110 011 767

Expected output:
372655943


Actual output:
33235204


Fixed submission (verdict: Accepted):
N,M,K=map(int,input().split())
MOD=10**9+7
ans=0
x,y=1,1
k=min(K-2,N*M-K)
for i in range(k):
    x*=N*M-2-i
    y*=k-i
    x%=MOD
    y%=MOD
comb=x*pow(y,MOD-2,MOD)
comb%=MOD
for i in range(1,N):
    a=i*comb*(N-i)*M**2
    ans+=a
    ans%=MOD
for i in range(1,M):
    a=i*comb*(M-i)*N**2
    ans+=a
    ans%=MOD
print(ans%MOD)
Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
C = "Christmas"
E =" EVE"
D = input()
D = int(D)
a = 25 - D
q=""
 
while a > 0:
  q = q + E
  a = a - 1
 
print(C+q)

Failing test case input:
-68

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Christmas EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE EVE


Fixed submission (verdict: Accepted):
C = "Christmas"
E =" Eve"
D = input()
D = int(D)
a = 25 - D
q=""
 
while a > 0:
  q = q + E
  a = a - 1
 
print(C+q)
Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

a = 25 - int(input())
print("Christmas " + "Eve" * a)


Failing test case input:
-177

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Christmas EveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEve


Fixed submission (verdict: Accepted):

a = 25 - int(input())
print("Christmas" + " Eve" * a)

Problem: p03206
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a=int(input())
print("Christmas","Eve"*3)

Failing test case input:
-88

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Christmas EveEveEve


Fixed submission (verdict: Accepted):
a=int(input())
print("Christmas","Eve "*(25-a))
Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print("Christmas" + " ".join(["Eve"] * (25 - int(input()))))

Failing test case input:
-82

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
ChristmasEve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Fixed submission (verdict: Accepted):
print("Christmas" + (" Eve" * (25 - int(input()))))
Problem: p03206
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
D = int(input())

A = ["Chrinstmas"]

for i in range(25 - D):
  A.append("Eve")

S = ''.join(A)

print(S)

Failing test case input:
-55

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
ChrinstmasEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEve


Fixed submission (verdict: Accepted):
D = int(input())

A = ["Christmas"]

for i in range(25 - D):
  A.append("Eve")

S = ' '.join(A)

print(S)

Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d = int(input())


print("Chirstmas"+" Eve" * (25 - d))

Failing test case input:
-45

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Chirstmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Fixed submission (verdict: Accepted):
d = int(input())


print("Christmas"+" Eve" * (25 - d))

Problem: p03206
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
D = int(input())
print('Chrismas' + " Eve"*(25-D))

Failing test case input:
-31

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Chrismas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Fixed submission (verdict: Accepted):
D = int(input())
print('Christmas' + " Eve"*(25-D))
Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D = int(input())
print("Christmas"+"Eve"*(25-D))

Failing test case input:
-49

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
ChristmasEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEve


Fixed submission (verdict: Accepted):
D = int(input())
print("Christmas"+" Eve"*(25-D))

Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D = int(input())

print('Chiristmas'+' Eve'*(25-D))


Failing test case input:
-46

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Chiristmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Fixed submission (verdict: Accepted):
D = int(input())

print('Christmas'+' Eve'*(25-D))
Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
nokori = n-25
eve = ' Eve'*nokori
print('Christmas'+eve)

Failing test case input:
-463

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Christmas


Fixed submission (verdict: Accepted):
n = int(input())
nokori = 25-n
eve = ' Eve'*nokori
print('Christmas'+eve)
Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print("Chrismas"+" Eve"*(25-int(input())))

Failing test case input:
-83

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Chrismas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Fixed submission (verdict: Accepted):
print("Christmas"+" Eve"*(25-int(input())))

Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
D = int(input())
res = 'Christmas'
for _ in range(D, 25):
    res += 'Eve'
print(res)

Failing test case input:
-180

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
ChristmasEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEveEve


Fixed submission (verdict: Accepted):
D = int(input())
res = 'Christmas'
for _ in range(D, 25):
    res += ' Eve'
print(res)
Problem: p03206
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print('Chrismas ', end='')
for i in range(0,25-n):
    print('Eve ',end='')


Failing test case input:
-177

Expected output:
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve


Actual output:
Chrismas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve 

Fixed submission (verdict: Accepted):
n = int(input())
print('Christmas ', end='')
for i in range(0,25-n):
    print('Eve ',end='')
Problem: p00375
Buggy submission (Python3, verdict: Wrong Answer):
print((int(input())-30)/2)


Failing test case input:
2835

Expected output:
1402


Actual output:
1402.5


Fixed submission (verdict: Accepted):
print(int((int(input())-30)/2))

Problem: p00375
Buggy submission (Python3, verdict: Wrong Answer):
a=int(input())
print((a-30)/2)


Failing test case input:
319

Expected output:
144


Actual output:
144.5


Fixed submission (verdict: Accepted):
a=int(input())
print((a-30)
Problem: p03568
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(i) for i in input().split()]

ans = 2**N
tmp = 1
for a in A:
  if a%2==0:
    tmp *= 2
print(ans - tmp)

Failing test case input:
10
28 110 6 3 8 0 6 2 -1 210

Expected output:
58793


Actual output:
768


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(i) for i in input().split()]

ans = 3**N
tmp = 1
for a in A:
  if a%2==0:
    tmp *= 2
print(ans - tmp)

Problem: p03568
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A=list(map(int,input().split()))
hiku=1
ans=1
for i in A:
        if i%2 == 1:hiku*=2
        ans*=3
print(ans-hiku)

Failing test case input:
10
60 101 94 98 83 7 6 25 114 120

Expected output:
58985


Actual output:
59033


Fixed submission (verdict: Accepted):
N=int(input())
A=list(map(int,input().split()))
hiku=1
ans=1
for i in A:
        if i%2 == 0:hiku*=2
        ans*=3
print(ans-hiku)

Problem: p03568
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
f=1
for i in a:
  if i&1:
    f=0
print(3**n-1-f)

Failing test case input:
3
1 8 -3

Expected output:
25


Actual output:
26


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
f=1
for i in a:
  if i%2==0:
    f<<=1
print(3**n-f)
Problem: p03568
Buggy submission (Python (3.4.3), verdict: Wrong Answer):





from functools import reduce
from itertools import repeat


def multipler(x, y):
    return x*y

def hundred_or_one(l: list):
    return [True if x == 100 else False for x in l]
    

def check_odds(l :list):
    return [True if x % 2 == 0 else False for x in l]

def check_hun(l: list):
    return [True if x == 100 else False for x in l]

def main(num, data:list):
    
    hun_one = hundred_or_one(data)
    odds = check_odds(data)  
    huns = check_hun(data)

    basis = [3 for t in hun_one]

    
    remover = [2 if o else 1 for o in odds]

    remover_num = int(reduce(multipler, remover))
    if sum(huns) > 0:
        remover_num = int(remover_num / 2 ** sum(huns))

    basic_answer = reduce(multipler, basis)
    
    
    return basic_answer - remover_num

if __name__ == '__main__':
    
    
    num = int(input())
    data = input().split(" ")
    data = [int(i) for i in data]

    print(main(num, data))


Failing test case input:
10
105 100 94 98 114 7 6 27 114 120

Expected output:
58921


Actual output:
58985


Fixed submission (verdict: Accepted):





from functools import reduce
from itertools import repeat


def multipler(x, y):
    return x*y

def hundred_or_one(l: list):
    return [True if x == 100 else False for x in l]
    

def check_odds(l :list):
    return [True if x % 2 == 0 else False for x in l]

def check_hun(l: list):
    return [True if x == 100 else False for x in l]

def main(num, data:list):
    
    hun_one = hundred_or_one(data)
    odds = check_odds(data)  
    huns = check_hun(data)

    basis = [3 for t in hun_one]

    
    remover = [2 if o else 1 for o in odds]

    remover_num = int(reduce(multipler, remover))
    
    

    basic_answer = reduce(multipler, basis)
    
    
    return basic_answer - remover_num

if __name__ == '__main__':
    
    
    num = int(input())
    data = input().split(" ")
    data = [int(i) for i in data]

    print(main(num, data))

Problem: p03568
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
ans=1
for k in a:
  if k&1:
    ans*=2
print(ans)

Failing test case input:
10
105 100 94 98 114 7 6 27 114 120

Expected output:
58921


Actual output:
8


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
ans=1
for k in a:
  if k%2==0:
    ans*=2
print(pow(3,n)-ans)