TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.  Snuke will perform the following operation zero or more times:    * Choose two stones painted in the same color. Repaint all the stones between them, with the color of the chosen stones.  Find the number of possible final sequences of colors of the stones, modulo 10^9+7.

Submission attempts (in order):
import numpy as np

n = int(input())
c = np.array([int(input()) for _ in range(n)])

MOD = 10**9 + 7


dp = np.zeros(n, dtype=np.int64)
dp[0] = 1

used = np.full(c.max() + 1, -1, dtype=np.int64)

for i in range(1, n):
    if used[c[i]] == -1:
        dp[i] = dp[i - 1]
    else:
        dp[i] = (dp[i - 1] + dp[used[c[i]]]) % MOD
    used[c[i]] = i

print(dp[-1])

import numpy as np

n = int(input())
tmp = [int(input()) for _ in range(n)]

c = [tmp[0]]
for x in tmp[1:]:
    if x != c[-1]:
        c.append(x)

c = np.array(c)

MOD = 10**9 + 7


dp = np.zeros(c.shape[0], dtype=np.int64)
dp[0] = 1

used = np.full(c.max() + 1, -1, dtype=np.int64)
used[c[0]] = 1

for i in range(1, c.shape[0]):
    if used[c[i]] == -1:
        dp[i] = dp[i - 1]
    else:
        dp[i] = (dp[i - 1] + dp[used[c[i]]]) % MOD
    used[c[i]] = i

print(dp[-1])

Verdicts: Wrong Answer

Accepted
Problem: There are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.  Snuke will perform the following operation zero or more times:    * Choose two stones painted in the same color. Repaint all the stones between them, with the color of the chosen stones.  Find the number of possible final sequences of colors of the stones, modulo 10^9+7.

Submission attempts (in order):
N = int(input())
L = [int(input()) for i in range(N)]

ans = 1

D = {}
for i in range(N) :
    if str(L[i]) not in D :
        D[str(L[i])] = 1
    else :
        if L[i-1] == L[i] :
            ans += (D[str(L[i])]-1)
            D[str(L[i])] += 1
        else :
            ans += D[str(L[i])]
            D[str(L[i])] += 1
ans %= (10**9+7)
print(ans)


N = int(input())
L = [input() for i in range(N)]

dp = [1 for i in range(N)]

last = {}

for i in range(N) :
    if i == 0 :
        last[L[i]] = i
    else :
        if L[i] not in last :
            dp[i] = dp[i-1]
        elif L[i] == L[i-1] :
            dp[i] = dp[i-1]
        else :
            j = last[L[i]]
            dp[i] = dp[i-1] + dp[j]
        
        last[L[i]] = i

ans = dp[N-1]
ans %= 10**9+7
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N stones arranged in a row. The i-th stone from the left is painted in the color C_i.  Snuke will perform the following operation zero or more times:    * Choose two stones painted in the same color. Repaint all the stones between them, with the color of the chosen stones.  Find the number of possible final sequences of colors of the stones, modulo 10^9+7.

Submission attempts (in order):
N = int(input())
C = [int(input()) for _ in range(N)]
C = [x for (x,y) in zip(C[:-1], C[1:]) if x!=y] + [C[-1]]

SUM = 1
DP_dict = {}

for c in C:
  if c in DP_dict.keys():
    SUM += DP_dict[c] = SUM
  DP_dict[c] = SUM

print(SUM % (10**9+7))

N = int(input())
C = [int(input()) for _ in range(N)]
C = [x for (x,y) in zip(C[:-1], C[1:]) if x!=y] + [C[-1]]

SUM = 1
DP_dict = {}

for c in C:
  if c in DP_dict.keys():
    SUM += DP_dict[c]
  DP_dict[c] = SUM

print(SUM % (10**9+7))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=input().split()
h,w=input().split()

ans=(H-h)*(W-w)

print(ans)

H,W=int(input().split())
h,w=int(input().split())

ans=(H-h)*(W-w)

print(ans)

H,W=map(int,input().split())
h,w=map(int,input().split())

ans=(H-h)*(W-w)

print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
N, M = map(int, input().split())
drink = []
cost = 0
count = 0
d_count = 0
rest = 0


for _ in range(N):
    Drink = list(map(int, input().split()))
    drink.append(Drink)
    drink.sort()

for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1]
    count += 1
    if d_count > M:
      break
      
cost -= drink[count-1][0] * drink[count-1][1]
d_count -= drink[count-1][1]
rest = M - d_count
cost += rest * drink[count-1][0]
print(cost)
    


H, W = map(int, input().split())
h, w = map(int, input().split())

h2 = H - h
w2 = W - w

print(h2*w2)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W = map(int, input().split())
h, w = map(int, input().split())

printf((H - h) * (W - w))

H, W = map(int, input().split())
h, w = map(int, input().split())

print((H - h) * (W - w))


Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * W + w * H - h * w)

H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * w - (h * W + w * H - h * w))


H, W = map(int, input().split())
h, w = map(int, input().split())
print(H * W - (h * W + w * H - h * w))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
i = list()
for x in range(2):
  i.append(map(int,input().split()))
print(i[0][0]-i[1][0])*(i[0][1]-i[1][1])

i = list()
for x in range(2):
  i.append(map(int,input().split()))
return (i[0][0]-i[1][0])*(i[0][1]-i[1][1])

i = list()
for x in range(2):
  i.append([int(x) for x in input().split()])
print((i[0][0]-i[1][0])*(i[0][1]-i[1][1]))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
#coding:utf-8

H, W = input().split()
h, w = input().split()

ans = (H - h) * (W - w)
print(ans)

#coding:utf-8

H, W = input().split()
h, w = input().split()

for s in [H,W,h,w]:
    s = int(s)
    print(type(s))

ans = (H - h) * (W - w)
print(ans)

#coding:utf-8

H, W = input().split()
h, w = input().split()

for s in [H,W,h,w]:
    int(s)

ans = (H - h) * (W - w)
print(ans)

#coding:utf-8

H, W = input().split()
h, w = input().split()

ans = ( int(H)-int(h) ) * ( int(W)-int(w) )
print(ans)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input().split())
h,w=map(int,input(),split())
print((H-h)*(W-w))

H,W=map(int,input().split())
h,w=map(int,input(),split())
print((H-h)*(W-w))

H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H*W)-(h*w))

H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W*w))

H,W = map(int,input().split())
h,w = map(int,input().split())
x = H*W- h*w
print(x)

H,W = map(int,input().split())
h,w = map(int,input().split())

print((H*W)-(h*w))

H,W = map(int,input().split())
h,w = map(int,input().split())
x = (H*W)-(h*w)
print(x)

H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
from itertools import combinations, product


def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


def get(fmt):
    ps = input().split()
    r = []
    for p, t in zip(ps, fmt):
        if t == "i":
            r.append(int(p))
        if t == "f":
            r.append(float(p))
        if t == "s":
            r.append(p)
    if len(r) == 1:
        r = r[0]
    return r

def put(*args, **kwargs):
    print(*args, **kwargs)


def rep(n, f, *args, **kwargs):
    return [f(*args, **kwargs) for _ in range(n)]
    
def rep_im(n, v):
    return rep(n, lambda: v)
    
YES_NO = ["NO", "YES"]

H, W = get("ii")
h, w = get("ii")

put(H * W - h * H - w * W + h * w)

from itertools import combinations, product


def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


def get(fmt):
    ps = input().split()
    r = []
    for p, t in zip(ps, fmt):
        if t == "i":
            r.append(int(p))
        if t == "f":
            r.append(float(p))
        if t == "s":
            r.append(p)
    if len(r) == 1:
        r = r[0]
    return r

def put(*args, **kwargs):
    print(*args, **kwargs)


def rep(n, f, *args, **kwargs):
    return [f(*args, **kwargs) for _ in range(n)]
    
def rep_im(n, v):
    return rep(n, lambda: v)
    
YES_NO = ["NO", "YES"]

H, W = get("ii")
h, w = get("ii")

put(H * W - h * W - w * H + h * w)

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
lh, lw = input().split()
h, w = input().split()

print(lh * lw - lh * w - lw * h + h + w)


lh, lw, h, w = map(int, open(0).read().split())
print((lh - h) * (lw - w))


Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int, input().split())
h1,w1 = map(int, input().split())
sum = H*h1
sum1 = W*w1
sum2 = h1*w1
ans = sum+sum1-sum2
print(H*W-ans)


H,W = map(int, input().split())
h1,w1 = map(int, input().split())
sum = H-h1
sum1 = W-w1


print(sum*sum1)


Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
A,B=map(int,input().split())
def calc(A):
    if A%4==0:
        return A
    elif A%4==1:
        return 1
    elif A%4==2:
        return A+1
    else:
        return 0
print(calc(A-1)^calc(B))


H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a,b = map(int,input().split())
print((a-1) * (b-1))

H,W = map(int,input().split())
h,w = [int(i) for i in input().split()]
n = (H-h) * (W-w)
print(n)


Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input().solit())
h,w=map(int,input().split())

print(h*W+H*w-h*w)

H,W=map(int,input().split())
h,w=map(int,input().split())

print(h*W+H*w-h*w)

H,W=map(int,input().split())
h,w=map(int,input().split())

print(H*W-h*W+H*w-h*w)


H,W=map(int,input().split())
h,w=map(int,input().split())

print(H*W-h*W-H*w+h*w)


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int, input().split(','))
h,w = map(int, input().split(','))
print((H-h)*(W-w))

H,W = map(int, input().split(' '))
h,w = map(int, input().split(' '))
print((H-h)*(W-w))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a,b=map(int,input().split())
c,d=map(int,input().split())
print(a*b-c*d)


a,b=map(int,input().split())
c,d=map(int,input().split())
print(a*b-c*b-d*a+c*d)


Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W = [int(i) for input().split()]
bh, bw = [int(i) for input().split()]

res = (H * W) - ((bh*W) + (bh*H) - (bh*bw))

print(res)

H, W = [int(i) for i in input().split()]
bh, bw = [int(i) for i in input().split()]

res = (H * W) - ((bh*W) + (bw*H) - (bh*bw))

print(res)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
if __name__ == "__main__":
    list_1=input("数字を入力：").split()
    H=int(list_1[0])
    W=int(list_1[1])

    list_2=input("数字を入力：").split()
    h=int(list_2[0])
    w=int(list_2[1])
    
    Ans = (H-h)*(W-w)
    print(Ans)
    pass

if __name__ == "__main__":
    list_1=input("数字を入力：").split()
    H=int(list_1[0])
    W=int(list_1[1])

    list_2=input("数字を入力：").split()
    h=int(list_2[0])
    w=int(list_2[1])
    
    Ans = (H-h)*(W-w)
    print(Ans)


def main():
    H, W = map(int, input().split())
    h, w = map(int, input().split())
    Ans = (H-h)*(W-w)
    print(Ans)


if __name__ == "__main__":
    main()

    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(min([(H-h) * (W-w), 0]))

H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h) * (W-w))


Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*w+W*h-h*w)

H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-(H*w+W*h-h*w))

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a, b = (int(i) for i in input().split())
c, d = (int(i) for i in input().split())

print(a*b - c*a - d*b + c*d)

a, b = (int(i) for i in input().split())
c, d = (int(i) for i in input().split())

print(a*b - b*c - a*d + c*d)

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W =int(input().split())
h, w =int(input().split())
print((H-h)*(W-w))

H, W =[int(i) for i in input().split()]
h, w =[int(i) for i in input().split()]
print((H-h)*(W-w))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=list(map(int,input().split()))
h,w=list(map(int,input().split()))

answer=(H-h)-(W-w)

print(answer)

H,W=list(map(int,input().split()))
h,w=list(map(int,input().split()))

answer=(H*h)-(W*w)

print(answer)

H,W=list(map(int,input().split()))
h,w=list(map(int,input().split()))

answer=(H-h)*(W-w)

print(answer)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
#B
count = 0
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
for i in range(n):
    a = list(map(int, input().split()))
    ab=0
    for j in range(n):
        ab = a[j] * b[j]
    if -c<ab:
        count += 1
print(count)

#A
H,W = map(int, input().split())
h,w = map(int, input().split())

print((H-h)*(W-w))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int,input().split())
h,w = map(int,input().split())
print(H*W-h*W-wH+h*w)

H,W = map(int,input().split())
h,w = map(int,input().split())
print(H*W-h*W-w*H+h*w)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W = map(int,input().split())
h, w = map(int,input().split())
print(H * w + h * W - h * w)

H, W = map(int,input().split())
h, w = map(int,input().split())
print(H * W - H * w - h * W + h * w)

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
import math

a, b = map(int, input().split())  

A = list()
B = list()

if b == 0:
    B = [0]
elif b == 1:
    B = [1]
else:
    for i in range(1, int(math.log2(b))+2):
        tmp = b // (2 ** i) * 2 ** (i - 1)

        if b % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = b % (2 ** i) - 2 ** (i-1) + 1

        B.append(tmp + plus)

if a == 0:
    A = [0]
elif a == 1:
    A = [0]
else:
    for i in range(1, int(math.log2(a-1))+2):
        tmp = (a-1) // (2 ** i) * 2 ** (i - 1)

        if (a-1) % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = (a-1) % (2 ** i) - 2 ** (i-1) + 1

        A.append(tmp + plus)

ans = 0
for i in range(0, int(math.log2(b)) + 1):
    print(i)
    if i >= len(A):
        ans += (B[i]) % 2 * 10 ** i
    else:
        ans += (B[i] - A[i]) % 2 * 10 ** i

print(int(str(ans), 2))


a, b = map(int, input().split())  
c, d = map(int, input().split())  
print((a-c)*(b-d))


Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
A,B=map(int,input().split())
a,b=map(int,input().split())
print(a*b-((A-a)*b+(B-b)*a))

A,B=map(int,input().split())
a,b=map(int,input().split())
print(A*B-((A-a)*b+(B-b)*a))

A,B=map(int,input().split())
a,b=map(int,input().split())
print((A*B)-(a*b+(A-a)*b+(B-b)*a))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
N, M = map(int, input().split(" "))
stores = dict()
p = 10000000000

for i in range(N):
    if 1 in stores and stores[1] >= M:
      break
    Ai, Bi = map(int, input().split(" "))
    if Ai in stores:
        stores[Ai] += Bi
    else:
        stores[Ai] = Bi
    p = min(p, Ai)


price = 0
while True:
    if p in stores:
        if M <= stores[p]:
            price += p * M
            break
        else:
            price += p * stores[p]
            M -= stores[p]
    p += 1
print(price)


H, W = map(int, input().split(" "))
h, w = map(int, input().split(" "))
print((H - h)*(W - w))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int,input())
h,w = map(int,input())
print(int(H * W - h * w))

H,W = map(int,input().split())
h,w = map(int,input().split())
print(int(H * W - h * w))


H,W = map(int,input().split())
h,w = map(int,input().split())
A = H - h
B = W - w
print(int(A * B))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H-h*W-w)

H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-(H-h)*(W*w))

H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a,b = map(int,input().split())
c,d = map(int,input().split())
print(a*b-c*d)

H=input()
W=input()
h=input()
w=input()

H=int(H)
W=int(W)
h=int(h)
w=int(w)

print(H*W-w*H-h*W+w*h)

H=input()
W=input()
h=input()
w=input()

H=int(H)
W=int(W)
h=int(h)
w=int(w)

print(HW-wH-hH-wh)

a,b = map(int,input().split())
c,d = map(int,input().split())
print((a-c)*(b-d))

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H1, W1 = map(int, input().split())
H2, W2 = map(int, input().split())

H=H1-H2
W=W1-W2

print(HW)

H1, W1 = map(int, input().split())
H2, W2 = map(int, input().split())

H=H1-H2
W=W1-W2

print(H*W)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a,b=map(int,input().split())
j=0
while b>=2**j:
    j+=1
k=1
l=[0 for i in range(j)]
bia=[0 for i in range(j)]
A=a
i=0
while A>2**(k-1):
    l[i]=A%(2**k)
    m=(l[i]-2**(k-1))
    if m<=0:
        bia[i]=0
    else:
        if m%2==1:
            bia[i]=1
        else:
            bia[i]=0
    k+=1
    i+=1
if (A//2)%2==0:
    bia[0]=0
else:
    bia[0]=1
k=1
l=[0 for i in range(j)]
bib=[0 for i in range(j)]
B=b+1
i=0
while B>2**(k-1):
    l[i]=B%(2**k)
    m=(l[i]-2**(k-1))
    if m<=0:
        bib[i]=0
    else:
        if m%2==1:
            bib[i]=1
        else:
            bib[i]=0
    k+=1
    i+=1
if (B//2)%2==0:
    bib[0]=0
else:
    bib[0]=1
ans=0
for i in range(j):
    if bia[i]==bib[i]:
        ans=ans
    else:
        ans+=2**i
print(ans)

H,W=list(map(int,input().split(" ")))
h,w=list(map(int,input().split(" ")))
print(H*W+h*w-H*w-W*h)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
#121-A
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
H,W=IL()
h,w=IL()
print(H*W-h*w)

#121-A
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
H,W=IL()
h,w=IL()
print((H-h)*(W-w))

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
import numpy as np
N,M = map(int,input().split())
A_s = []
for _ in range(N):
  A_s.append(list(map(int,input().split())))

A_s = sorted(A_s,key=lambda x:x[0])
money = 0
num = 0
pre_num = 0
for a_s in A_s:
  num += a_s[1]
  if num <= M:
    money += a_s[1] * a_s[0]
    pre_num += a_s[1]
  else:
    money += (M-pre_num) * a_s[0]
    break
  #print(money)
print(money)

import numpy as np
H,W = map(int,input().split())
h,w = map(int,input().split())
matrix = np.ones((H,W))
h_num = np.random.choice(H,h,replace=False)
w_num = np.random.choice(W,w,replace=False)

for _ in h_num:
  matrix[_,:] = 0
for _ in w_num:
  matrix[:,_] = 0

print(np.sum(matrix))

import numpy as np
A,B = map(int,input().split())
b = np.arange(A,B+1)
def bin2np(a):
  return list(map(int,list(bin(a)[2:])))

max_length = len(bin2np(b[-1]))

bin2list = []
for a in b:
  c = bin2np(a)
  for _ in range(max_length-len(c)):
    c.insert(0,0)
  #print(c)
  bin2list.append(c)
bin2list = np.array(bin2list)
bin2s = list(map(str,np.where(np.sum(bin2list,axis=0)==1,1,0)))
print(int("".join(bin2s),2))
    

import numpy as np
H,W = map(int,input().split())
h,w = map(int,input().split())
matrix = np.ones((H,W))
h_num = np.random.choice(H,h,replace=False)
w_num = np.random.choice(W,w,replace=False)

for _ in h_num:
  matrix[_,:] = 0
for _ in w_num:
  matrix[:,_] = 0

print(int(np.sum(matrix)))


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int, input().split())
h,w = map(int, input().split())
answer = (H-h)*(W-w)
print(ans)

H,W = map(int,input().split())
h,w = map(int,input().split())
ans = (H-h)*(W-w)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int,input().split)
h,w = map(int,input().split)
print((H-h)*(W-w))


a,b = map(int,input().split)
h,w = map(int,input().split)
print(a*b -a*w-b*h+h*w)


a,b = map(int,input().split)
h,w = map(int,input().split)
print((a-h)*(b-w))


a,b = map(int,input().split)
print(a*b -a-b+1)

H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w)


# -*- coding: utf-8 -*-
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))


Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(int,input().split())
h,w = = map(int,input().split())
print((H-h)*(W-w))

H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = list(map(int, input().split(' '))
h,w = list(map(int, input().split(' '))
print((H-h)*(W-w))

H,W = list(map(int, input().split(' ')
h,w = list(map(int, input().split(' ')
pritn((H-h)*(W-w))

H,W = list(map(int, input().split(' ')))
h,w = list(map(int, input().split(' ')))
print((H-h)*(W-w))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a = list(map(int,inputr().split()))
b = list(map(int,inputr().split()))
print((a[0]-b[0])*(a[1]-b[1]))

a = list(map(int,input().split()))
b = list(map(int,input().split()))
print((a[0]-b[0])*(a[1]-b[1]))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*（W-w）)

H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a,b = map(int, input().split())
c,d = map(int, input().split())
i=a*b
print(i-(a-c)*(b-d))

H,W = map(int, input().split())
h,w = map(int, input().split())
print((H*W)-((W*h)+(w*(H-h))))

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
s = [input().split() for i in range(2)]
print(s)

a, b, c, d = int(s[0][0]), int(s[0][1]), int(s[1][0]), int(s[1][1])

sum_cells_count = a * b
row_cells_count = b * c
col_cells_count = (a - c) * d

filled_cells_count = row_cells_count + col_cells_count

blank_cells_count = sum_cells_count - filled_cells_count
print(blank_cells_count)


s = [input().split() for i in range(2)]
print(s)

sum_cells_count = s[0][0] * s[0][1]
row_cells_count = s[0][1] * s[1][0]
col_cells_count = s[0][0] - s[1][0]

filled_cells_count = row_cells_count + col_cells_count

return sum_cells_count - filled_cells_count


s = [input().split() for i in range(2)]
print(s)

a, b, c, d = int(s[0][0]), int(s[0][1]), int(s[1][0]), int(s[1][1])

sum_cells_count = a * b
row_cells_count = b * c
col_cells_count = (a - c) * d

filled_cells_count = row_cells_count + col_cells_count

blank_cells_count = sum_cells_count - filled_cells_count
blank_cells_count


N, M, C = map(int, input().split())
a = []
for i in range(N+1):
    a.append(list(map(int, input().split())))

count = 0
sum = 0
for i in range(1, N+1):
    for j in range(M):
        sum += int(a[0][j]) * int(a[i][j])
    if sum + int(C) > 0:
        count += 1
        sum = 0
    else:
        sum = 0

print(count)


s = [input().split() for i in range(2)]

a, b, c, d = int(s[0][0]), int(s[0][1]), int(s[1][0]), int(s[1][1])

sum_cells_count = a * b
row_cells_count = b * c
col_cells_count = (a - c) * d

filled_cells_count = row_cells_count + col_cells_count

blank_cells_count = sum_cells_count - filled_cells_count
print(blank_cells_count)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:40:34 2019

@author: iwata
"""

N,M = map(int, input().split())
numlist =[]
money = 0
count = 0
count1 = 0
count2 = 0

for i in range(N):
    AB = list(map(int, input().split()))
    numlist.append(AB)

numlist.sort()

while count <= M:
    while numlist[count1][1] >= count2:
        money = money + numlist[count1][0]
        count = count + 1
        count2 = count2 + 1
        if count == M:
            break
    count1 = count1 + 1
    count2 = 0
    
print(money)


# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:40:34 2019

@author: iwata
"""

N,M = map(int, input().split())
numlist =[]
money = 0
count = 0
count1 = 0
count2 = 0

for i in range(N):
    AB = list(map(int, input().split()))
    numlist.append(AB)

numlist.sort()

while count < M:
    while numlist[count1][1] > count2:
        money = money + numlist[count1][0]
        count = count + 1
        count2 = count2 + 1
        if count == M:
            break
    count1 = count1 + 1
    count2 = 0
    
print(money)


# -*- coding: utf-8 -*-
"""
Created on Sat Mar  9 21:07:57 2019

@author: iwata
"""

H,W = map(int, input().split())
h,w = map(int, input().split())

num = H*W - (h*W+(H-h)*w)
print(num)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W =map(int,input().split()) 
h,w =map(int,input().split()) 
print((H-w)*(W-w))

h =lambda :map(int,input().split()) 
H,W =h()
h,w =h()
print((H-h)*(W-w))

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
n,m,c = map(int,input().split())
input_b = map(int,input().split())
a_list=[input() for i in range(n)]
aa_list=map(int,a_list.split())
for i in range(n):
  answer = c
  count = 0
  lista_item = aa_list[i]
  for j in range(m):
    answer += input_b[m] * lista_item[m]
  if answer > 0
    count+=1
print count

n,m,c = map(int,input().split())
input_b = map(int,input().split())
while True:
  try:
    list_a=list(map(int,input().split()))
    answer = c
    count = 0
    for i in range(len(list_a)):
    answer += input_b[i] * list_a[i]
    if answer > 0
      count+=1
    print count
  except:
    break;

w,h = map(int,input().split())
W,H = map(int,input().split())
print(str((W-w)*(H-h)))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
#!/usr/bin/env python
# -*- coding:utf-8 -*-

import numpy as np

N_s, M_s, C_s = input().split()
N = int(N_s)
M = int(M_s)
C = int(C_s)

B = [int(i) for i in input().split()]
A = []
for rows in range(0,N):
    tmp = [int(i) for i in input().split()]
    A.append(tmp)

B_array = np.array(B)
A_array = np.array(A)

val = np.dot(A_array, B_array) + C
print(np.sum(val>0))

#!/usr/bin/env python
#-*- coding:utf-8 -*-

H_s,W_s = input().split()
h_s,w_s = input().split()

H = int(H_s)
W = int(W_s)
h = int(h_s)
w = int(w_s)

num_total    = H * W
num_black_h  = h * W
num_black_w  = H * w
num_black_hw = h * w
num_white = num_total - num_black_h - num_black_w + num_black_hw

print(num_white)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-h*W-w*H+2*h*w)

H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-h*W-w*H+h*w)

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
hP,wP = map(int,input().split())
hC,wC = map(int,input().split())

ans = hP * wP
ans -= (hP+wP-1)

print(ans)

H,W = map(int,input().split())
h,w = map(int,input().spilt())

ans = h*W + w*H - h*w
print(ans)

H,W = map(int, input().split())
h,w = map(int, input().split())


print(H*W - h*W - w*H + h*w)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W=map(int,input())
h,w=map(int,input())
print((H-h)*(W-w))

H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H - h) + (W - w))

H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * W + H * w - h * w)

H, W = map(int, input().split())
h, w = map(int, input().split())
print(int((H - h) * (W - w)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H=int(input())
W=int(input())
h=int(input())
w=int(input())

a = (H-h) * (W-w)
print(a)

H, W = map(int, input().split())
h, w = map(int, input().split())
a = (H-h) * (W-w)
print(a)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H, W =map(int,input().split())
h, w =map(int,input().split())
print(H*W-h-w+1)

H, W =map(int,input().split())
h, w =map(int,input().split())
print(H*W-h*W-w*H+h*w)

Verdicts: Wrong Answer

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
a,b=map((int,input()).split())
c,d=map((int,input()).split())
print(a*b-c*b-d*a)

a,b=map(int,input().split())
c,d=map(int,input().split())
print((a-c)*(b-d))


Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
N,M,C = map(int, input().split())
B = list(map(int, input().split()))
ans=0
for i in range(N):
    A = list(map(int, input().split()))
    ssum = sum([A[i]*B[i] for i in range(M)])+C
    if ssum>0:
        ans+=1
print(ans)

H,W=map(int, (input().split()))
h,w=map(int, (input().split()))
ans=H*W-h*W-H*w+h*w
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
min = min(A, B, C, D, E)
 
ans = 4 + int(N/min)
if N % min != 0:
    ans = ans + 1
print(ans)

H, W = map(int,input().split())
h, w = map(int,input().split())

val = H * (W - w)
dis = h*(W-w)
val = val - dis
print(val)

Verdicts: Runtime Error

Accepted
Problem: There are H rows and W columns of white square cells.  You will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.  How many white cells will remain?  It can be proved that this count does not depend on what rows and columns are chosen.

Submission attempts (in order):
H,W = map(input().spilt())
w,h = map(input().spilt())
print((H - h) * (W - w))

H,W = map(int,input().split())
h,w = map(int,input().split())
print((H - h) * (W - w))

Verdicts: Runtime Error

Accepted