ZhenlongDai/ACPR huggingface dataset:
Problem: p02622
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=list(input().split())
t=list(input().split())
ans=0
for i in range(len(s)):
  if s[i]!=t[i]:
    ans+=1
print(ans)

Failing test case input:
ffgdmdfqpuc
oeutaieppud

Expected output:
9


Actual output:
1


Fixed submission (verdict: Accepted):


s=list(input())
t=list(input())
ans=0
for i in range(len(s)):
  if s[i]!=t[i]:
    ans+=1
print(ans)

Problem: p02622
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = list(map(str,input().split()))
b = list(map(str,input().split()))
count = 0
for i in range(0,len(a)) :
  if a[i] != b[i] :
    count = count + 1

print(count)

Failing test case input:
pknad
oajph

Expected output:
5


Actual output:
1


Fixed submission (verdict: Accepted):
a = str(input())
b = str(input())
count = 0
for i in range(0,len(a)) :
  if a[i] != b[i] :
    count = count + 1

print(count)

Problem: p02622
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
t=input()
ans=0

for n in range(len(s)):
  if s[n]==t[n]:
    ans+=0
  else:
    ans+=1

print(min(ans,len(s)-ans))
    

Failing test case input:
efffndfopuc
cupofhottea

Expected output:
11


Actual output:
0


Fixed submission (verdict: Accepted):
s=input()
t=input()
ans=0

for n in range(len(s)):
  if s[n]==t[n]:
    ans+=0
  else:
    ans+=1

print(ans)

Problem: p02622
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
sys.setrecursionlimit(2147483647)
input=sys.stdin.readline

def main():
  S = input()
  T = input()
  count = 0
  for i in range(len(S)):
    if(S[i] != T[i]):
      count+=1
  print(len(T)-count)

if __name__=='__main__':
  main()

Failing test case input:
btmqgdpdggf
dopuei_tvep

Expected output:
11


Actual output:
1


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

def main():
  S = input()
  T = input()
  count = 0
  for i in range(len(S)):
    if(S[i] != T[i]):
      count+=1
  print(count)

if __name__=='__main__':
  main()
Problem: p02316
Buggy submission (Python3, verdict: Wrong Answer):
N,W = map(int, input().split())
dp = [0]*(W+1)
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1,b):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(dp[W])



Failing test case input:
4 8
4 2
5 2
2 1
8 3

Expected output:
21

Actual output:
20


Fixed submission (verdict: Accepted):
N,W = map(int, input().split())
dp = [0 for i in range(W+1)]
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(max(dp))

Problem: p02316
Buggy submission (Python3, verdict: Wrong Answer):
N, W = map(int, input().split())
value = []
weight = []
dp = [0 for _ in range(W + 1)]
for i in range(N):
    v, w = map(int, input().split())
    for j in range(W+1):
        if j >= w:
            dp[j] = max(dp[j], dp[j - w] + v)
        else:
            break
print(dp[W])

Failing test case input:
4 8
4 2
5 2
2 1
8 3

Expected output:
21

Actual output:
0


Fixed submission (verdict: Accepted):
N, W = map(int, input().split())
value = []
weight = []
dp = [0 for _ in range(W + 1)]
for i in range(N):
    v, w = map(int, input().split())
    for j in range(W+1):
        if j >= w:
            dp[j] = max(dp[j], dp[j - w] + v)
print(dp[W])

Problem: p02316
Buggy submission (Python3, verdict: Wrong Answer):
N,W = map(int, input().split())
dp = [0]*(W+1)
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1,b):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(W+1)



Failing test case input:
4 8
4 2
5 2
2 1
8 3

Expected output:
21

Actual output:
9


Fixed submission (verdict: Accepted):
N,W = map(int, input().split())
dp = [0 for i in range(W+1)]
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(max(dp))

Problem: p02316
Buggy submission (Python3, verdict: Wrong Answer):
N,W = map(int, input().split())
dp = [0 for i in range(W+1)]
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1,b):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(dp[W])



Failing test case input:
4 8
4 2
5 2
2 1
8 3

Expected output:
21

Actual output:
20


Fixed submission (verdict: Accepted):
N,W = map(int, input().split())
dp = [0 for i in range(W+1)]
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(max(dp))

Problem: p02316
Buggy submission (Python3, verdict: Wrong Answer):
N, W = map(int, input().split())
value = []
weight = []
dp = [0 for _ in range(W + 1)]
for i in range(N):
    v, w = map(int, input().split())
    for j in range(w+1):
        if j >= w:
            dp[j] = max(dp[j], dp[j - w] + v)
        else:
            break
print(dp[W])

Failing test case input:
4 8
4 2
5 2
2 1
8 3

Expected output:
21

Actual output:
0


Fixed submission (verdict: Accepted):
N, W = map(int, input().split())
value = []
weight = []
dp = [0 for _ in range(W + 1)]
for i in range(N):
    v, w = map(int, input().split())
    for j in range(W+1):
        if j >= w:
            dp[j] = max(dp[j], dp[j - w] + v)
print(dp[W])
Problem: p02316
Buggy submission (Python3, verdict: Wrong Answer):
N,W = map(int, input().split())
dp = [0 for i in range(W+1)]
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1,b):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(max(dp))



Failing test case input:
4 8
4 2
5 2
2 1
8 3

Expected output:
21

Actual output:
20


Fixed submission (verdict: Accepted):
N,W = map(int, input().split())
dp = [0 for i in range(W+1)]
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(max(dp))
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h, w = map(int, input().split())
S = [input().split() for _ in range(h)]
for i in range(h):
    for j in range(w):
        if S[i][j] == 'snuke':
            print(chr(i+65) + str(j+1))



Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
F8


Fixed submission (verdict: Accepted):
h, w = map(int, input().split())
S = [input().split() for _ in range(h)]
for i in range(h):
    for j in range(w):
        if S[i][j] == 'snuke':
            print(chr(j+65) + str(i+1))
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h,w=map(int,input().split())
l=[list(input().split()) for _ in range(h)]
print(l)
for i in range(h):
    for j in range(w):
        if l[i][j]=="snuke":
            print(str(chr(ord("A")+j))+str(i+1))
            exit()


Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
[['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snuke', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake'], ['snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake', 'snake']]
H6


Fixed submission (verdict: Accepted):
h,w=map(int,input().split())
l=[list(input().split()) for _ in range(h)]
for i in range(h):
    for j in range(w):
        if l[i][j]=="snuke":
            print(str(chr(ord("A")+j))+str(i+1))
            exit()
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h,w=map(int,input().split())
for i in range(h):
  a=input()
  if 'snuke' in a:
    b=a.find('snuke')
    break
print(chr(ord('A')+b)+str(i+1))

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
k6


Fixed submission (verdict: Accepted):
h,w=map(int,input().split())
for i in range(h):
  a=input()
  if 'snuke' in a:
    b=a.find('snuke')
    break
print(chr(ord('A')+b

Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

H, W = map(int, input().split())
ab = [chr(ord('A') + i) for i in range(26)]
for i in range(H):
    S = input().split()
    for j in range(W):
        if S[j] == "snuke":
            print(ab[i]+str(i+1)) 
            break
        break
        

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:

Fixed submission (verdict: Accepted):

H, W = map(int, input().split())
ab = [chr(ord('A') + i) for i in range(26)]
for i in range(H):
    S = input().split()
    for j in range(W):
        if S[j] == "snuke":
            print(ab[j]+str(i+1)) 
            break
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map( int, input().split() )
s = [ list( map( str, input().split() ) ) for i in range(H) ] 
for i in range(H) : 
    for j in range(W) : 
       if s[i][j] == "snuke" : 
           w = chr( j + ord( "A" ) )
           h = i + 1
           exit()
print( w + str( h ) )

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:

Fixed submission (verdict: Accepted):
H, W = map( int, input().split() )
s = [ list( map( str, input().split() ) ) for i in range(H) ] 
for i in range(H) : 
    for j in range(W) : 
       if s[i][j] == "snuke" : 
           w = chr( j + ord( "A" ) )
           h = i + 1
           print( w + str( h ) )
           exit()

Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,M=map(int,input().split())
c=0
for i in range(H):
    S=input().split()
    for j in range(0,M):
        if S[j]=="snuke":
            a=i
            b=j
        else:
            c+=1

print(chr(ord('A')+a) + str(b+1))

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
F8


Fixed submission (verdict: Accepted):
H,M=map(int,input().split())
c=0
for i in range(1,H+1):
    S=input().split()
    for j in range(0,M):
        if S[j]=="snuke":
            a=i
            b=j
        else:
            c+=1

print(chr(ord('A')+b) + str(a))
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
S = [list(input().split()) for _ in range(H)]
for i in range(H):
	for j in range(W):
		if S[i][j] == "snuke":
			print(chr(97 + i).upper() + str(j + 1))
			exit()


Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
F8


Fixed submission (verdict: Accepted):
H, W = map(int, input().split())
S = [list(input().split()) for _ in range(H)]
for i in range(H):
	for j in range(W):
		if S[i][j] == "snuke":
			print(chr(97 + j).upper() + str(i + 1))
			exit()

Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W = map(int,input().split())

answer = ''
for row in range(H):
  for col,s in enumerate(input().split()):
    if s == 'snuke':
      answer = chr(ord('A')+col) + str(row)

print(answer)
  

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
H5


Fixed submission (verdict: Accepted):
H,W = map(int,input().split())

answer = ''
for row in range(H):
  for col,s in enumerate(input().split()):
    if s == 'snuke':
      answer = chr(ord('A')+col) + str(row+1)

print(answer)
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(str, input().split()))
  for j in range(M):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]))

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
H5


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(str, input().split()))
  for j in range(M):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]+1))

Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import string
H, W = map(int, input().split())
a = []
for i in range(H):
    a.append(input().split())

for i in range(H):
    for j in range(W):
        if a[i][j] == 'snuke':
            print(string.ascii_lowercase[j]+str(i+1))
            break

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
h6


Fixed submission (verdict: Accepted):
import string
H, W = map(int, input().split())
a = []
for i in range(H):
    a.append(input().split())

for i in range(H):
    for j in range(W):
        if a[i][j] == 'snuke':
            print(string.ascii_uppercase[j]+str(i+1))
            break
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h,w=map(int,input().split())
a=[input().split() for _ in range(h)]
for i in range(h):
  for j in range(w):
    if(a[i][j]=="sunuke"):
      print(chr(65+j)+str(i+1))

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:

Fixed submission (verdict: Accepted):
h,w=map(int,input().split())
a=[input().split() for _ in range(h)]
for i in range(h):
  for j in range(w):
    if(a[i][j]=="snuke"):
      print(chr(65+j)+str(i+1))

Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = list(map(int, input().split()))
S = [input().split() for i in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == 'snuke':
            ans = [chr(i) for i in range(97, 97+26)][j] + str(i + 1)
            break


print(ans)



Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
h6


Fixed submission (verdict: Accepted):
import string

H, W = list(map(int, input().split()))
S = [input().split() for i in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == 'snuke':
            ans = string.ascii_uppercase[j] + str(i + 1)
            break


print(ans)
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
next(sys.stdin)
r = 1
for line in sys.stdin:
    line = list(line.strip().split())
    try:
        c = line.index('snuke')
        print(str(r) + chr(ord('A') + c))
        break
    except ValueError:
        pass
    r += 1


Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:
6H


Fixed submission (verdict: Accepted):
import sys
next(sys.stdin)
r = 1
for line in sys.stdin:
    line = list(line.strip().split())
    try:
        c = line.index('snuke')
        print(chr(ord('A') + c) + str(r))
        break
    except ValueError:
        pass
    r += 1
Problem: p03919
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from string import *
h,w=map(int,input().split())

s=[None]*h
for i in range(h):
    s[i] = [None]*w
    for j in range(w):
        if(s[i][j]=='snuke'):
            idx1=ascii_lowercase[i].swapcase()
            idx2=str(j+1)
            print(idx1+idx2)
            exit()

Failing test case input:
15 10
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snuke snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake

Expected output:
H6

Actual output:

Fixed submission (verdict: Accepted):
from string import *
h,w=map(int,input().split())

s = [input().split() for _ in range(h)]

for i in range(h):
    for j in range(w):
        if(s[i][j]=='snuke'):
            idx1=ascii_lowercase[j].swapcase()
            idx2=str(i+1)
            print(idx1+idx2)
            exit()
Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
mod = 1e9+7
xtot = 0
ytot = 0
for i in range(n):
	xtot += (2*i-n+1)*x[i]
for i in range(m):
	ytot += (2*i-m+1)*y[i]
xtot = xtot % mod
ytot = ytot % mod
print(int((xtot*ytot)%mod))

Failing test case input:
6 5
-983443749 -192321079 101593039 418379342 586260100 802780784
-253230108 244757027 363756450 712662868 735867677

Expected output:
341329571


Actual output:
341329579


Fixed submission (verdict: Accepted):
n, m = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
mod = 1000000007
xtot = 0
ytot = 0
for i in range(n):
	xtot += (2*i-n+1)*x[i]
	xtot %= mod
for i in range(m):
	ytot += (2*i-m+1)*y[i]
	ytot %= mod
print(int((xtot*ytot)%mod))

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
sx=0
sy=0
for i in range(n):
    sx+=i*x[i]-(n-i-1)*x[i]
for i in range(m):
    sy+=i*y[i]-(m-i-1)*y[i]
print(sx*sy)

Failing test case input:
6 5
-983443749 -293179180 212428642 418379342 586260100 802780784
-116893124 193944314 556319375 1032972003 1322749268

Expected output:
27828333


Actual output:
87569167984011999930


Fixed submission (verdict: Accepted):

n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
sx=0
sy=0
for i in range(n):
    sx+=i*x[i]-(n-i-1)*x[i]
for i in range(m):
    sy+=i*y[i]-(m-i-1)*y[i]
sx=sx%(10**9+7)
sy=sy%(10**9+7)
ans=sx*sy%(10**9+7)
print(ans)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

q = 10**9+7

x_sum = 0
y_sum = 0
for i in range(n):
    x_sum += (2*i - n + 1) * x[i]
    
for i in range(m):
    y_sum += (2*i - n + 1) * y[i]

print(x_sum * y_sum)

Failing test case input:
6 5
-983443749 -293179180 212428642 418379342 586260100 802780784
-116893124 193944314 556319375 712662868 1322749268

Expected output:
512227813


Actual output:
48599676896280139875


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

q = 10**9+7

x_sum = 0
y_sum = 0
for i in range(n):
    x_sum += (2*i - n + 1) * x[i]
    
for i in range(m):
    y_sum += (2*i - m + 1) * y[i]

print(  ((x_sum * y_sum )%q) )
Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N,M = map(int, input().split())
X = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]

MOD = 10 ** 9 + 7

def f(Z):
    ans = 0
    for k,z in enumerate(Z):
        ans = (ans + k * z - (N - k - 1) * z) % MOD
    return ans

print(f(X) * f(Y) % MOD)

Failing test case input:
6 5
-790013317 -192321079 145832190 418379342 586260100 802780784
-253230108 193944314 363756450 712662868 1456457554

Expected output:
532945562


Actual output:
829073897


Fixed submission (verdict: Accepted):

N,M = map(int, input().split())
X = [int(i) for i in input().split()]
Y = [int(i) for i in input().split()]

MOD = 10 ** 9 + 7

def f(Z):
    ans = 0
    for k,z in enumerate(Z):
        ans = (ans + k * z - (len(Z) - k - 1) * z) % MOD
    return ans

print(f(X) * f(Y) % MOD)

Problem: p03762
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
x = [x for x in map(int, input().split())]
y = [y for y in map(int, input().split())]
sum_x = 0
sum_y = 0
ans = 0
for i in range(n):
    sum_x += (2*i - n + 1) * x[i] 
for j in range(m-1):
    sum_y += (2*j - m + 1) * y[j]
ans = sum_x * sum_y
print(ans%1000000007)

Failing test case input:
6 5
-983443749 -228848563 106922086 418379342 666143127 802780784
-253230108 54513325 556319375 712662868 735867677

Expected output:
891102706


Actual output:
582258494


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
x = [x for x in map(int, input().split())]
y = [y for y in map(int, input().split())]
sum_x = 0
sum_y = 0
ans = 0
for i in range(n):
    sum_x += (2*i - n + 1) * x[i] 
for j in range(m):
    sum_y += (2*j - m + 1) * y[j]
ans = sum_x * sum_y
print(ans%1000000007)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


line = input().split(" ")
n = int(line[0])
m = int(line[1])

x = 0
for (k,nn) in enumerate(input().split(" ")):
    nn = int(nn)
    x += k*nn - (n-k-1)*nn

y = 0
for (k,nn) in enumerate(input().split(" ")):
    nn = int(nn)
    y += k*nn - (n-k-1)*nn

print((x*y)%(10**9+7))


Failing test case input:
6 5
-983443749 -293179180 35840588 418379342 586260100 802780784
-35400205 193944314 556319375 712662868 1322749268

Expected output:
695999919


Actual output:
21292891


Fixed submission (verdict: Accepted):


line = input().split(" ")
n = int(line[0])
m = int(line[1])

x = 0
line1 = input().split(" ")
for (k,nn) in enumerate(line1):
    nn = int(nn)
    x += k*nn - (n-k-1)*nn


y = 0
line2 = input().split(" ")
for (k,nn) in enumerate(line2):
    nn = int(nn)
    y += k*nn - (m-k-1)*nn

print((x*y)%(10**9+7))
Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

q = 10**9+7

x_sum = 0
y_sum = 0
for i in range(n):
    x_sum += (2*i - n + 1) * x[i]
    
for i in range(m):
    y_sum += (2*i - n + 1) * y[i]

print( ((x_sum % q) * (y_sum % q) %q) )

Failing test case input:
6 5
-1862253218 -88495641 7026056 39264869 586260100 879837555
-253230108 41587467 363756450 649329355 1151847131

Expected output:
533555538


Actual output:
838241530


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

q = 10**9+7

x_sum = 0
y_sum = 0
for i in range(n):
    x_sum += (2*i - n + 1) * x[i]
    
for i in range(m):
    y_sum += (2*i - m + 1) * y[i]

print(  ((x_sum * y_sum )%q) )

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
area=0
mod=10**9+7

x=0

for i in range(n):
  x += -(n-i-1)*X[i]+i*X[i]
  print("x",x)

y = 0

for i in range(m):
  y += -(m-i-1)*Y[i]+i*Y[i]

print(x*y%mod)

Failing test case input:
6 5
-983443749 -293179180 70970418 418379342 586260100 802780784
-253230108 193944314 556319375 712662868 735867677

Expected output:
127978169


Actual output:
x 4917218745
x 5796756285
x 5725785867
x 6144165209
x 7902945509
x 11916849429
127978169


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
area=0
mod=10**9+7

x=0

for i in range(n):
  x += -(n-i-1)*X[i]+i*X[i]

y = 0

for i in range(m):
  y += -(m-i-1)*Y[i]+i*Y[i]

print(x*y%mod)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
a = 0
b = 0
Mod = 10**9 + 7

for k in range(1,n+1):
    a += (k-1)*x[k-1] - (n-k)*x[k-1]
for j in range(1,m+1):
    b += (j-1)*y[j-1] - (m-j)*y[j-1]

res = a*b
print(a*b)

Failing test case input:
6 5
-983443749 -427981748 95834122 371122782 666143127 802780784
-253230108 54513325 556319375 712662868 735867677

Expected output:
224630636


Actual output:
65849499613171124700


Fixed submission (verdict: Accepted):
n,m = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))
a = 0
b = 0
Mod = 10**9 + 7

for k in range(1,n+1):
    a += (k-1)*x[k-1] - (n-k)*x[k-1]
for j in range(1,m+1):
    b += (j-1)*y[j-1] - (m-j)*y[j-1]

res = a*b
print(a*b%Mod)
Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
xsum=0;ysum=0;mod=10**9+7
for i,x in enumerate(X): xsum+=x*(i-(n-1-i))
for i,y in enumerate(Y): ysum+=y*(i-(m-1-i))
print(xsum, ysum)
print(xsum * ysum % mod)

Failing test case input:
6 5
-790013317 -192321079 145832190 418379342 548213257 802780784
-253230108 193944314 363756450 712662868 735867677

Expected output:
287138696


Actual output:
10458120665 4993828248
287138696


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
xsum=0;ysum=0;mod=10**9+7
for i,x in enumerate(X): xsum+=x*(i-(n-1-i))
for i,y in enumerate(Y): ysum+=y*(i-(m-1-i))
print(xsum * ysum % mod)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
mod=10**9+7
def f(a):
    c=0
    for i in range(len(a)):
        c+=a[i]-a[0]
    d=c
    for i in range(1,len(a)-1):
        d+=c-(len(a)-i)*(a[i]-a[i-1])
    return d%mod
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print(f(a)*f(b)%mod)

Failing test case input:
6 5
-244028396 -192321079 95834122 418379342 586260100 802780784
-253230108 193944314 363756450 1317613418 2970611207

Expected output:
591512668


Actual output:
90714578


Fixed submission (verdict: Accepted):
mod=10**9+7
def f(a):
    c=0
    for i in range(len(a)):
        c+=a[i]-a[0]
    d=c
    for i in range(1,len(a)-1):
        d+=c-(len(a)-i)*(a[i]-a[i-1])
        c-=(len(a)-i)*(a[i]-a[i-1])
    return d%mod
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print(f(a)*f(b)%mod)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

sum_x = 0
for i in range(0, n):
    sum_x += i * x[i] - (n - (i + 1)) * x[i]

sum_y = 0
for i in range(0, m):
    sum_y += i * y[i] - (n - (i + 1)) * y[i]

ans = sum_x * sum_y

divide_num = pow(10, 9) + 7
print(ans % divide_num)


Failing test case input:
6 5
-983443749 -427981748 95834122 418379342 666143127 802780784
-253230108 54513325 556319375 712662868 735867677

Expected output:
506828796


Actual output:
847506308


Fixed submission (verdict: Accepted):
n, m = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))

sum_x = 0
for i in range(0, n):
    sum_x += i * x[i] - (n - (i + 1)) * x[i]

sum_y = 0
for i in range(0, m):
    sum_y += i * y[i] - (m - (i + 1)) * y[i]

ans = sum_x * sum_y

divide_num = pow(10, 9) + 7
print(ans % divide_num)
Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
X = [int(x) for x in input().split()]
Y = [int(x) for x in input().split()]
p = 10 ** 9 + 7
ans = 0
for i in range(n - 1):
  for j in range(m - 1):
    S = (X[i + 1] - X[i]) * (Y[j + 1] - Y[j]) * (n - i - 1) * (i + 1) * (m - j - 1) * (j + 1) % p
    ans += S
print(ans % p + 1)

Failing test case input:
6 5
-1862253218 -88495641 7026056 88148787 586260100 879837555
-253230108 41587467 363756450 712662868 1151847131

Expected output:
780308303


Actual output:
780308304


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
p = 10 ** 9 + 7
X = [int(x) for x in input().split()]
Y = [int(x) for x in input().split()]
XX = [(X[i + 1] - X[i]) * (n - i - 1) * (i + 1) % p for i in range(n - 1)]
YY = [(Y[j + 1] - Y[j]) * (m - j - 1) * (j + 1) % p for j in range(m - 1)]
print(sum(XX) * sum(YY) % p)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,=map(int,input().split())
*b,=map(int,input().split())
*a,=map(int,input().split())
mod=10**9+7
ans=(n-1)*(m-1)*(max(b)-min(b))*(max(a)-min(a))%mod
print(ans)

Failing test case input:
6 5
-983443749 -293179180 212428642 418379342 586260100 802780784
-100731807 193944314 556319375 712662868 1322749268

Expected output:
588723078


Actual output:
552307416


Fixed submission (verdict: Accepted):
n,m,=map(int,input().split())
*x,=map(int,input().split())
*y,=map(int,input().split())
mod=10**9+7
print(sum((2*i-n-1)*x[i-1]for i in range(1,n+1))*sum((2*i-m-1)*y[i-1]for i in range(1,m+1))%mod)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n,m = [int(x) for x in sys.stdin.readline().split()]
x = [int(x) for x in sys.stdin.readline().split()]
y = [int(x) for x in sys.stdin.readline().split()]
r = 0
for i in range(n):
	for j in range(i+1,n):
		dx = x[j]-x[i]
		for k in range(m):
			for l in range(k+1,m):
				dy = y[l]-y[k]
				r += dx*dy
print(r)

Failing test case input:
6 5
-983443749 -192321079 2426101 418379342 586260100 802780784
-75000300 193944314 673482340 712662868 1151847131

Expected output:
991328499


Actual output:
69452338498157694576


Fixed submission (verdict: Accepted):
import sys
n,m = [int(x) for x in sys.stdin.readline().split()]
x = [int(x) for x in sys.stdin.readline().split()]
y = [int(x) for x in sys.stdin.readline().split()]
r = 0
mod = 10**9+7
def sumof(a,b):
	s = 0
	for i in range(a):
		s += (2*(i+1)-a-1)*b[i]
		s %= mod
	return s
r = (sumof(n,x)*sumof(m,y))%mod
print(r)
Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int, input().split())
xl = list(map(int, input().split())) 
yl = list(map(int, input().split())) 

xi=0
yi=0

xsum = sum(xl)
ysum = sum(yl)
for i in range(n):
    xi += xsum - xl[i]*(n-i)
    xsum -= xl[i] 
    
for j in range(m):
    yi += ysum - yl[j]*(m-j)
    ysum -= yl[j]

print(xi*yi)

Failing test case input:
6 5
-790013317 -192321079 145832190 418379342 548213257 802780784
-253230108 193944314 363756450 712662868 735867677

Expected output:
287138696


Actual output:
52226058397869544920


Fixed submission (verdict: Accepted):
n,m = map(int, input().split())
xl = list(map(int, input().split())) 
yl = list(map(int, input().split())) 

xl = list(map(lambda x: x-xl[0],xl))
yl = list(map(lambda x: x-yl[0],yl))

xi=0
yi=0
mod = 10**9+7
xsum = sum(xl)
ysum = sum(yl)
for i in range(n):
    xi += (xsum - xl[i]*(n-i)) % mod
    xsum -= xl[i] 
    
for j in range(m):
    yi += (ysum - yl[j]*(m-j)) % mod
    ysum -= yl[j]

print(xi*yi % mod)

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


n,m= map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
yoko=0
tate=0
for i in range (0,len(x)-1):
  for j in range (i+1,len(x)):
    yoko+=x[j]-x[i]
for i in range (0,len(y)-1):
  for j in range (i+1,len(y)):
    tate+=y[j]-y[i]

print(yoko*tate)

Failing test case input:
6 5
-983443749 -293179180 212428642 418379342 586260100 802780784
-116893124 193944314 556319375 712662868 1322749268

Expected output:
512227813


Actual output:
80025637241691684580


Fixed submission (verdict: Accepted):


n,m= map(int, input().split())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
yoko=0
tate=0
for i in range (0,len(x)):
  yoko+=(n-2*i-1)*x[i]
for i in range (0,len(y)):
  tate+=(m-2*i-1)*y[i]

print(yoko*tate%(10**9+7))

Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def rren(): return list(map(int, input().split()))
n, m = rren()
x = rren()
y = rren()
ans = 0
x_sum = 0
y_sum = 0
for now_x in range(n):
    x_sum += x[now_x] * (now_x - (n-1 - now_x))
for now_y in range(m):
    y_sum += y[now_y] * (now_y - (m-1 - now_y))

print(x_sum * y_sum)





Failing test case input:
6 5
-244028396 -192321079 95834122 418379342 586260100 802780784
-253230108 141613157 363756450 1317613418 2970611207

Expected output:
873318952


Actual output:
120337313389234506774


Fixed submission (verdict: Accepted):
def rren(): return list(map(int, input().split()))
n, m = rren()
x = rren()
y = rren()
ans = 0
x_sum = 0
y_sum = 0
for now_x in range(n):
    x_sum += x[now_x] * (now_x - (n-1 - now_x))
for now_y in range(m):
    y_sum += y[now_y] * (now_y - (m-1 - now_y))

print(x_sum * y_sum % 1000000007)
Problem: p03762
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
mod = 1e9+7
xtot = 0
ytot = 0
for i in range(n):
	xtot += (2*i-n+1)*x[i]
	xtot %= mod
for i in range(m):
	ytot += (2*i-m+1)*y[i]
	ytot %= mod
print(int((xtot*ytot)%mod))

Failing test case input:
6 5
-983443749 -228848563 95834122 418379342 586260100 1187093440
-253230108 54513325 556319375 712662868 735867677

Expected output:
851330279


Actual output:
851330270


Fixed submission (verdict: Accepted):
n, m = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
mod = 1000000007
xtot = 0
ytot = 0
for i in range(n):
	xtot += (2*i-n+1)*x[i]
	xtot %= mod
for i in range(m):
	ytot += (2*i-m+1)*y[i]
	ytot %= mod
print(int((xtot*ytot)%mod))
Problem: p02881
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n = int(input())
sq = math.floor(pow(n, 0.5))
flg = False
for i in range(2, sq + 1):
    if n % i == 0:
        flg = True
        break
if flg:
    print(((sq - 1) * 2) + (n - sq**2))
else:
    print(n - 1)


Failing test case input:
1486743

Expected output:
2742


Actual output:
3218


Fixed submission (verdict: Accepted):
import math
n = int(input())
sq = math.floor(pow(n, 0.5))
ans = []
for i in range(2, sq + 1):
    if n % i == 0:
        ans.append((i - 1) + ((n 
if len(ans) > 0:
    print(min(ans))
else:
    print(n - 1)

Problem: p02881
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N**(1/2) >= 2:
  for x in range(int(N**(1/2)), 1, -1):
    if (N % x == 0):
      print(int(x + N/x - 2))
      break
  print(N-1)
else:
  print(N-1)

Failing test case input:
19768873

Expected output:
9812


Actual output:
9812
19768872


Fixed submission (verdict: Accepted):
N = int(input())
def findSteps(n):
  for x in range(int(n**(1/2)), 1, -1):
    if (n % x == 0):
      return (int(x + n/x - 2))
  return (N-1)
 
print(findSteps(N))

Problem: p02881
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
b = 10**12
a = int(n**0.5)
for i in range(1,a+1):
  if n%i==0:
    b = min(b,i+(n/i)-2)
print(b)

Failing test case input:
2326170

Expected output:
3051


Actual output:
3051.0


Fixed submission (verdict: Accepted):
n = int(input())
 
b = 10**12
a = int((n**0.5)
for i in range(1,a+1):
  if n%i==0:
    b = min(b,int(i+(n
print(b)

Problem: p02881
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())
a = N
b = round(math.sqrt(N))

for i in range(b):
  j = i + 1
  if N % j == 0:
    if a > j + N / j:
      a = j + N / j
print(int(a) - 2)

Failing test case input:
10000000019

Expected output:
10000000018

Actual output:
10000000017


Fixed submission (verdict: Accepted):
import math

N = int(input())
a = N + 1
b = round(math.sqrt(N))

for i in range(b):
  j = i + 1
  if N % j == 0:
    if a > j + N / j:
      a = j + N / j
print(round(a) - 2)

Problem: p02881
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
N=10000000019
han=999999999999999999999999999999999999999999
b=0



for a in range(1,int(math.sqrt(N))+1):
    if N%a==0:
        A=N/a
        if A>a:
            gou=A-a
        else:
            gou=a-A
        b=a
        if gou<han:
            han=gou
            kot=A+a
if b==A:
    print(int(kot)-1)
else:
    print(int(kot)-2)


Failing test case input:
6518607

Expected output:
2172870


Actual output:
10000000018


Fixed submission (verdict: Accepted):
import math
N=int(input())

han=999999999999999999999999999999999999999999
b=0



for a in range(1,int(math.sqrt(N))+1):
    if N%a==0:
        A=N/a
        if A>a:
            gou=A-a
        else:
            gou=a-A
        b=a
        if gou<han:
            han=gou
            kot=A+a

print(int(kot)-2)