ZhenlongDai/ACPR huggingface dataset:
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()

ans = ""
for i in range(len(S)-len(T)+1):
    incflag = False
    flag = True
    for s,t in zip(S[i:],T):
        if s == t:
            incflag = True
        if s != "?" and s != t:
            flag = False
            break
    if flag and incflag:
        ans = S[:i]+T
if ans != "":
    print(ans.replace("?","a"))
else:
    print("UNRESTORABLE")

Failing test case input:
d>>>???q
a`a

Expected output:
d>>>a`aq


Actual output:
UNRESTORABLE


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

ans = ""
for i in range(len(S)-len(T)+1):
    flag = True
    for s,t in zip(S[i:],T):
        if s != "?" and s != t:
            flag = False
            break
    if flag:
        ans = S[:i]+T+S[i+len(T):]
if ans != "":
    print(ans.replace("?","a"))
else:
    print("UNRESTORABLE")

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re
Sd = input().strip()
T = input().strip()
Sd = Sd.replace('?','.')
ls, lt = len(Sd), len(T)
if ls < lt :
    print('UNRESTORABLE')
else :
    ans = []
    for i in range(ls - lt + 1) :
        m = re.match(Sd[i:1 + lt], T)
        if m is None :
            continue
        ans.append((Sd[:i] + T + Sd[i + lt:]).replace('.','a'))
    if not ans :
        print('UNRESTORABLE')
    else :
        print(min(ans))


Failing test case input:
=?d??p??
_ba

Expected output:
UNRESTORABLE


Actual output:
=ad_baaa


Fixed submission (verdict: Accepted):
import re


def solve(s, t):
    s = s.replace('?', '.')
    ls, lt = len(s), len(t)
    if ls < lt:
        return 'UNRESTORABLE'
    ans = []
    for i in range(ls - lt + 1):
        m = re.match(s[i:i + lt], t)
        if m is None:
            continue
        ans.append((s[:i] + t + s[i + lt:]).replace('.', 'a'))
    if not ans:
        return 'UNRESTORABLE'
    return min(ans)


s = input().strip()
t = input().strip()

print(solve(s, t))

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
sd=input()
t=input()
lsd=len(sd)
lt=len(t)
for i in range(lsd-lt,-1,-1):
    for j in range(lt):
        if sd[i+j]!='?' and sd[i+j]!=t[j]:
            break
    else:
            ans=(sd[:i]+t+sd[i+lt:]).replace('?','a')
            break
else:
    print('UNRESTRABLE')

Failing test case input:
>?d??p??
_ba

Expected output:
UNRESTORABLE


Actual output:
UNRESTRABLE


Fixed submission (verdict: Accepted):
sd=input()
t=input()
lsd=len(sd)
lt=len(t)
for i in range(lsd-lt,-1,-1):
    for j in range(lt):
        if sd[i+j]!='?' and sd[i+j]!=t[j]:
            break
    else:
            print((sd[:i]+t+sd[i+lt:]).replace('?','a'))
            break
else:
    print('UNRESTORABLE')
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def match(x,y):
    if x==y or y=='?':
        return 1
    else:
        return 0
S=input()
T=input()
S=S[::-1]
T=T[::-1]

count=0
for j in range(0,len(S)-len(T)):
    for i in range(len(T)):
        if match(T[i],S[i+j]):
            count+=1
        else:
            count=0
            break
    if count==len(T):
        for k in range(len(T)):
            S=S.replace(S[k+j],T[k],1)
        S=S.replace('?','a')
        print(S[::-1])
        exit()
    else:
        count=0
print('UNRESTRABLE')


Failing test case input:
t@@?bA?
dbcnq

Expected output:
UNRESTORABLE


Actual output:
UNRESTRABLE


Fixed submission (verdict: Accepted):
def match(x,y):
    if x==y or y=='?':
        return 1
    else:
        return 0
S=input()
T=input()
U=""

candidate=[]
count=0

for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if match(T[j],S[i+j]):
            count+=1
        else:
            count=0
            break
    if count==len(T):
        count=0
        U=S[:i]+T+S[i+len(T):]
        U=U.replace('?','a')
        candidate.append(U)
        
if len(candidate)==0:
    print('UNRESTORABLE')
else:
    
    print(sorted(candidate)[0])

Problem: p03565
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
sp=input()
t=input()

m=len(sp)
n=len(t)
for i in range(m-n,-1,-1):
  cand=sp[:i].replace('?','a')+t+sp[i+n+1:].replace('?','a')
  f=0
  for j,w in enumerate(t):
    if sp[j+i]!=w and sp[j+i]!='?':
      f=1
      break
  if f==0:
    print(cand)
    sys.exit()
print('UNRESTOREBLE')


Failing test case input:
??b@@t@
gbrnc

Expected output:
UNRESTORABLE


Actual output:
UNRESTOREBLE


Fixed submission (verdict: Accepted):
import sys
sp=input()
t=input()

m=len(sp)
n=len(t)
for i in range(m-n,-1,-1):
  cand=sp[:i].replace('?','a')+t+sp[i+n:].replace('?','a')
  for j,w in enumerate(t):
    if sp[j+i]!=w and sp[j+i]!='?':
      break
  else:
    print(cand)
    sys.exit()
print('UNRESTORABLE')

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S,T=open(0);l,m=len(S),len(T)
for i in range(l-m):
 if all(c in"?"+d for c,d in zip(S[-i-1-m:],T)):S=S.replace("?","a");print(S[:-i-1-m]+T+S[l-i:]);quit()
print("UNRESTORABLE")

Failing test case input:
d>>>???q
aaa

Expected output:
d>>>aaaq


Actual output:
UNRESTORABLE


Fixed submission (verdict: Accepted):
S,T=input(),input();l,m=len(S),len(T)
for i in range(l-m+1):
 if all(c in"?"+d for c,d in zip(S[-i-m:],T)):S=S.replace("?","a");print(S[:-i-m]+T+S[l-i:]);quit()
print("UNRESTORABLE")
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
t = list(input())

def eq(s, t):
    for i in range(len(s)):
        if s[i] != t[i] and s[i] != '?':
            return False
    return True

for i in reversed(range(len(s) - len(t)+1)):
    if eq(s[i:i+len(t)], t[:]):
        s[i:i + len(t)] = t[:]
        ans = ''.join(s)
        print(ans.replace('?', 'b'))
        quit()
print('UNRESTORABLE')

Failing test case input:
>q???d?>
_ba

Expected output:
>q_bada>


Actual output:
>q_badb>


Fixed submission (verdict: Accepted):
s = list(input())
t = list(input())

def eq(s, t):
    for i in range(len(s)):
        if s[i] != t[i] and s[i] != '?':
            return False
    return True

for i in reversed(range(len(s) - len(t)+1)):
    if eq(s[i:i+len(t)], t[:]):
        s[i:i + len(t)] = t[:]
        ans = ''.join(s)
        print(ans.replace('?', 'a'))
        quit()
print('UNRESTORABLE')

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
T=input()
flg=False
counter=len(T)-1
for i in reversed(range(len(S))):
    if S[i]=='?':
        counter-=1
    else:
        if S[i]==T[counter]:
            counter-=1
        else:
            if S[i]==T[-1]:
                counter=len(T)-2
            else:
                counter=len(T)-1
    if counter<0:
        ini=i
        flg=True
        break
if flg:
    S1=S[:ini].replace('?','a')
    print(S1+T)
else:
    print('UNRESTORABLE')

Failing test case input:
>q???d?>
_ba

Expected output:
>q_bada>


Actual output:
>q_ba


Fixed submission (verdict: Accepted):
S=input()
T=input()
flg=False
ans='UNRESTORABLE'
for i in reversed(range(len(S)-len(T)+1)):
    if flg:
        break

    for j in range(len(T)):
        if S[i+j]==T[j] or S[i+j]=='?':
            pass
        else:
            break
        
        if j==len(T)-1:
            S=S.replace('?','a')
            ans=S[:i]+T+S[i+len(T):]
            flg=True
            break
print(ans)

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=input()
la=len(a)
lb=len(b)
ans="UNRESTORABLE"
for i in range(la-lb+1):
  k=1
  for j in range(lb):
    if a[i+j]=="?":
      continue
    if a[i+j]!=b[j]:
      k=0
  if k==1:
    ans=i
if ans=="UNRESTORABLE":
  print(ans)
else:
  print(a[:i].replace("?","a")+b)

Failing test case input:
d>>>???q
a`a

Expected output:
d>>>a`aq


Actual output:
d>>>aa`a


Fixed submission (verdict: Accepted):
a=input()
b=input()
la=len(a)
lb=len(b)
ans="UNRESTORABLE"
for i in range(la-lb+1):
  k=1
  for j in range(lb):
    if a[i+j]=="?":
      continue
    if a[i+j]!=b[j]:
      k=0
  if k==1:
    ans=i
if ans=="UNRESTORABLE":
  print(ans)
else:
  ans=a[:ans]+b+a[ans+lb:]
  print(ans.replace("?","a"))
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))

def main():
    s = IS()
    t = IS()
    ls = len(s)
    lt = len(t)
    for i in reversed(range(ls-lt+1)):
        ss = s[i:i+lt]
        for j in range(lt):
            if ss[j] == '?' or ss[j] == t[j]: continue
            else: break
        else:
            s = s[:i] + t
            ans = s.replace('?', 'a')
            print(ans)
            exit(0)
    print('UNRESTORABLE')


if __name__ == '__main__':
    main()


Failing test case input:
d>>>???q
a`a

Expected output:
d>>>a`aq


Actual output:
d>>>a`a


Fixed submission (verdict: Accepted):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))

def main():
    s = IS()
    t = IS()
    ls = len(s)
    lt = len(t)
    for i in reversed(range(ls-lt+1)):
        ss = s[i:i+lt]
        for j in range(lt):
            if ss[j] == '?' or ss[j] == t[j]: continue
            else: break
        else:
            s = s[:i] + t + s[i+lt:]
            ans = s.replace('?', 'a')
            print(ans)
            exit(0)
    print('UNRESTORABLE')

if __name__ == '__main__':
    main()

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=list(input())
T=list(input())
A=[]
for i in range(len(S)-len(T)+1):
    is_ok=1
    for j in range(i, i+len(T)):
        if S[j]!=T[j-i] and S[j]!='?':
            is_ok=0
    if is_ok:
        tmp=S[:]
        is_con=1
        for j in range(i, i+len(T)):
            tmp[j]=T[j-i]
        A.append(tmp)
print(A)
if len(A)==0:
    print("UNRESTORABLE")
    exit(0)
B=[]
for a in A:
    for i in range(len(a)):
        if a[i]=='?':
            a[i]='a'
    B.append(''.join(a))
B.sort()
print(B[0])


Failing test case input:
t?@?bA?
dbcnq

Expected output:
UNRESTORABLE


Actual output:
[]
UNRESTORABLE


Fixed submission (verdict: Accepted):
S=list(input())
T=list(input())
A=[]
for i in range(len(S)-len(T)+1):
    is_ok=1
    for j in range(i, i+len(T)):
        if S[j]!=T[j-i] and S[j]!='?':
            is_ok=0
    if is_ok:
        tmp=S[:]
        is_con=1
        for j in range(i, i+len(T)):
            tmp[j]=T[j-i]
        A.append(tmp)
if len(A)==0:
    print("UNRESTORABLE")
    exit(0)
B=[]
for a in A:
    for i in range(len(a)):
        if a[i]=='?':
            a[i]='a'
    B.append(''.join(a))
B.sort()
print(B[0])
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
sd = input()
t = input()
for i in range(len(sd) - len(t) + 1):
    t_kamo = sd[i:i + len(t)]
    for j in range(len(t) + 1):
        if j == len(t):
            s = sd[:i].replace("?", "a") + t
            print(s)
            exit()
        if t_kamo[j] == "?":
            continue
        elif t_kamo[j] != t[j]:
            break
print("UNRESTORABLE")

Failing test case input:
d>>>???q
aaa

Expected output:
d>>>aaaq


Actual output:
d>>>aaa


Fixed submission (verdict: Accepted):
sd = input()
t = input()
for i in range(len(sd) - len(t), -1, -1):
    t_kamo = sd[i:i + len(t)]
    for j in range(len(t) + 1):
        if j == len(t):
            s = sd[:i].replace("?", "a") + t + sd[i + len(t):].replace("?", "a")
            print(s)
            exit()
        if t_kamo[j] == "?":
            continue
        elif t_kamo[j] != t[j]:
            break
print("UNRESTORABLE")

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
S = input()
flag = False
for i in range(len(s)-len(S)+1):
    if s[i] == S[0] or s[i] == "?":
        a = s[i:i+len(S)]
        for j in range(len(S)):
            if a[j] == S[j] or a[j] == "?":
                continue
            break
        else:
            flag = True
            s = s[0:i]+S+s[i+len(S):]
            print(s)
print(s.replace("?","a") if flag == True else "UNRESTORABLE")

Failing test case input:
?tc????
coder

Expected output:
atcoder

Actual output:
?tcoder
atcoder


Fixed submission (verdict: Accepted):
s = input()
S = input()
flag = False
ans = []
for i in range(len(s)-len(S)+1):
    if s[i] == S[0] or s[i] == "?":
        a = s[i:i+len(S)]
        for j in range(len(S)):
            if a[j] == S[j] or a[j] == "?":
                continue
            break
        else:
            flag = True
            ans.append(s[:i]+S+s[i+len(S):])
if not flag:
    print("UNRESTORABLE")
    exit()
for i in range(len(ans)):
    ans[i] = ans[i].replace("?","a")
ans.sort()
print(ans[0])
Problem: p03565
Buggy submission (Python (2.7.6), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
s = input().rstrip("\n")
t = input().rstrip("\n")
flg = False


for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        
        if s[i+j] == t[j] or s[i+j] == '?':
            cnt+=1
        
    if cnt == len(t):
        cnt=i
        flg = True
        
 
if not flg:
    print("UNRESTORABLE")
else:
    li = list(s.replace("?","a"))
    
    for j in range(len(t)):
        
        li[cnt+j] = t[j]
    print("".join(li))


Failing test case input:
d>>>???q
aaa

Expected output:
d>>>aaaq


Actual output:
d>aaaaaq


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
s = input().rstrip("\n")
t = input().rstrip("\n")
flg = False

for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        
        if s[i+j] == t[j] or s[i+j] == '?':
            cnt+=1
        
    if cnt == len(t):
        temp=i
        flg = True
        
 
if not flg:
    print("UNRESTORABLE")
else:
    li = list(s.replace("?","a"))
    
    for j in range(len(t)):
        
        li[temp+j] = t[j]
    print("".join(li))

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def match(x,y):
    if x==y or y=='?':
        return 1
    else:
        return 0
S=input()
T=input()
S=S[::-1]
T=T[::-1]

count=0
for j in range(0,len(S)-len(T)):
    for i in range(len(T)):
        if match(T[i],S[i+j]):
            count+=1
        else:
            break
    if count==len(T):
        for k in range(len(T)):
            S=S.replace(S[k+j],T[k],1)
        U=S.replace('?','a')
        print(U[::-1])
        exit()
    else:
        count=0
print('UNRESTRABLE')

Failing test case input:
?tc??@?
endcr

Expected output:
UNRESTORABLE


Actual output:
UNRESTRABLE


Fixed submission (verdict: Accepted):
def match(x,y):
    if x==y or y=='?':
        return 1
    else:
        return 0
S=input()
T=input()
U=""

candidate=[]
count=0

for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if match(T[j],S[i+j]):
            count+=1
        else:
            count=0
            break
    if count==len(T):
        count=0
        U=S[:i]+T+S[i+len(T):]
        U=U.replace('?','a')
        candidate.append(U)
        
if len(candidate)==0:
    print('UNRESTORABLE')
else:
    
    print(sorted(candidate)[0])
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
sp = list(input())
t = list(input())
flag = False
cnt = -1
l = len(t)
for i in range(len(sp) - l+1):
    for j in range(l):
        if sp[i+j]  == t[j] or sp[i+j]  == "?":
            pass
        else:
            flag = True
    if flag:
        continue
    else:
        cnt = i
if cnt == -1:
    print("UNRESTORABLE")
else:
    for i in range(len(sp)):
        if sp[i] == "?" :
            if not cnt<= i <cnt+l:
                sp[i] ="a"
            else :
                sp[i] = t[i-cnt]
    print("".join(sp))


Failing test case input:
d>>>???q
a`a

Expected output:
d>>>a`aq


Actual output:
UNRESTORABLE


Fixed submission (verdict: Accepted):
sp = list(input())
t = list(input())
flag = False
cnt = -1
l = len(t)
for i in range(len(sp) - l+1):
    for j in range(l):
        if sp[i+j]  == t[j] or sp[i+j]  == "?":
            pass
        else:
            break
    else:
        cnt = i
if cnt == -1:
    print("UNRESTORABLE")
else:
    for i in range(len(sp)):
        if sp[i] == "?" :
            if not cnt<= i <cnt+l:
                sp[i] ="a"
            else :
                sp[i] = t[i-cnt]
    print("".join(sp))

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
T=input()
for i in range(len(S)-len(T),-1,-1):
  a=0
  for j in range(len(T)):
    if S[i+j]=="?":
      continue
    if S[i+j]!=T[j]:
      a=1
      break
  if a==0:
    for j in range(i):
      if S[j]=="?":
        print("a",end="")
      else:
        print(S[j],end="")
    print(T,end="")
    for j in range(i+len(T)+1,len(S)):
      if S[j]=="?":
        print("a",end="")
      else:
        print(S[j],end="")
    exit()
print("UNRESTORABLE")

Failing test case input:
d>>>???q
a`a

Expected output:
d>>>a`aq


Actual output:
d>>>a`a

Fixed submission (verdict: Accepted):
S=input()
T=input()
for i in range(len(S)-len(T),-1,-1):
  a=0
  for j in range(len(T)):
    if S[i+j]=="?":
      continue
    if S[i+j]!=T[j]:
      a=1
      break
  if a==0:
    for j in range(i):
      if S[j]=="?":
        print("a",end="")
      else:
        print(S[j],end="")
    print(T,end="")
    for j in range(i+len(T),len(S)):
      if S[j]=="?":
        print("a",end="")
      else:
        print(S[j],end="")
    exit()
print("UNRESTORABLE")
Problem: p03565
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = list(input())
t = list(input())

if len(t) > len(s):
    print('UNRESTORABLE')
    exit()

flag = 0
for i in range(len(s)):
    if s[i] == t[0]:
        for j in range(i+1, i+len(t)-1):
            if s[j] == '?' or s[j] == t[j-i]:
                flag = 1
            else:
                flag = 0
                break
    
    if flag:
        s[i:i+len(t)+1] = t
        break

if flag == 0:
    print('UNRESTORABLE')
    exit()

for k in range(len(s)):
    if s[k] == '?':
        s[k] = 'a'


print(''.join(s))

Failing test case input:
d>>>???q
aaa

Expected output:
d>>>aaaq


Actual output:
UNRESTORABLE


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

if len(t) > len(s):
    print('UNRESTORABLE')
    exit()

s = s[::-1]
t = t[::-1]

for i in range(len(s) - len(t) + 1):
    j = 0
    while True:
        if j == len(t):
            ans = s[:i] + t + s[i+len(t):]
            print(ans[::-1].replace('?', 'a', len(ans)))
            exit()
        if t[j] == s[i+j] or s[i+j] == '?':
            j += 1
        else:
            break
print("UNRESTORABLE")

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
sd=input()
t=input()
lsd=len(sd)
lt=len(t)
ans='UNRESTRABLE'
for i in range(lsd-lt):
    for j in range(lt):
        if sd[i+j]!='?' and sd[i+j]!=t[j]:
            break
        else:
            ans=(sd[:i]+t+sd[i+lt:]).replace('?','a')
        break
print(ans)

Failing test case input:
@tc??@?
endcq

Expected output:
UNRESTORABLE


Actual output:
UNRESTRABLE


Fixed submission (verdict: Accepted):
sd=input()
t=input()
lsd=len(sd)
lt=len(t)
for i in range(lsd-lt,-1,-1):
    for j in range(lt):
        if sd[i+j]!='?' and sd[i+j]!=t[j]:
            break
    else:
            print((sd[:i]+t+sd[i+lt:]).replace('?','a'))
            break
else:
    print('UNRESTORABLE')

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()
ns = len(s)
nt = len(t)
ss = []

for i in range(ns-nt+1):
    for j,k in zip(s[i:i+nt],t):
        if j == '?':
           continue
        if j != k:
           break
        else:
            s2 = s[:i] + t + s[i+nt:]
            s3 = s2.replace('?','a')
            ss.append(s3)
        
if len(ss) == 0:
    print('UNRESTORABLE')
else:
    print(list(sorted(ss))[0])

Failing test case input:
>q???d?>
_ba

Expected output:
>q_bada>


Actual output:
UNRESTORABLE


Fixed submission (verdict: Accepted):
s = input()
t = input()
ns = len(s)
nt = len(t)
ss = []

def match(s,t):
    for i,j in zip(s,t):
        if i == '?':
            continue
        if i != j:
            return False
    return True
    
for i in range(ns-nt+1):
    if match(s[i:i+nt], t):
        s2 = s[:i] + t + s[i+nt:]
        s3 = s2.replace('?','a')
        ss.append(s3)
        
if len(ss) == 0:
    print('UNRESTORABLE')
else:
    print(list(sorted(ss))[0])
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

candidate = ("z" * len(s)) + "a"
for i in range(len(s) - len(t) + 1):
    if s[i] == t[0] or s[i] == '?':
        for j in range(len(t)):
            if s[i + j] != '?' and t[j] != s[i + j]:
                break
        else:
            candidate = min(s[0:i] + t + s[i+len(t)+1:-1], candidate)
                
if candidate == ("z" * len(s)) + "a":
    print('UNRESTORABLE')
else:
    print(candidate.replace('?', 'a'))
                





Failing test case input:
>q???d?>
_ba

Expected output:
>q_bada>


Actual output:
>q_baa


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

candidate = ("z" * len(s)) + "a"
for i in range(len(s) - len(t) + 1):
    if s[i] == t[0] or s[i] == '?':
        for j in range(len(t)):
            if s[i + j] != '?' and t[j] != s[i + j]:
                break
        else:
            candidate = min(s[0:i] + t + s[i+len(t):], candidate)
                
if candidate == ("z" * len(s)) + "a":
    print('UNRESTORABLE')
else:
    print(candidate.replace('?', 'a'))

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S,T=input(),input()
m=len(S)

for i in range(len(T)-m+1):
 if all(c in"?"+d for c,d in zip(S[-i-m:],T)):
     S=S.replace("?","a")
     print(S[:-i-m]+T+S[-i:])
     quit()
print("UNRESTORABLE")

Failing test case input:
d>>>???q
aaa

Expected output:
d>>>aaaq


Actual output:
UNRESTORABLE


Fixed submission (verdict: Accepted):
S,T=input(),input();l,m=len(S),len(T)
for i in range(l-m+1):
 if all(c in"?"+d for c,d in zip(S[-i-m:],T)):S=S.replace("?","a");print(S[:-i-m]+T+S[l-i:]);quit()
print("UNRESTORABLE")

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
t=input()
u=len(t)
for i in (len(s)-u,-1,-1):
    for j in range(u):
        if s[i+j]!="?" and s[i+j]!=t[j]:
            break
    else:
        print(((s[:i]+t)+s[u+i:]).replace("?","a"))
        break
else:
    print("UNRESTORABLE")

Failing test case input:
??d??p??
bb_

Expected output:
UNRESTORABLE


Actual output:
aadaapabb_daapaa


Fixed submission (verdict: Accepted):
s=input()
t=input()
u=len(t)
for i in range(len(s)-u,-1,-1):
    for j in range(u):
        if s[i+j]!="?" and s[i+j]!=t[j]:
            break
    else:
        print((s[:i]+t+s[u+i:]).replace("?","a"))
        break
else:
    print("UNRESTORABLE")
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
SS=list(map(str,input()))
T=list(map(str,input()))
T1=len(T)
T2=T1-1
f=0
p=-1
j=0



for i in range(len(SS)-T1+1):
  if SS[i]==T[j] or SS[i]=="?" :
    p=i
    f=f+1
    
    j=j+1
    
    
    if f==T1 and p!=-1:
      break
  else:
    p=-1
    f=0
    j=0
  

for i in range(p,p+T1):
  SS[i]=T[i-p]
for i in range(len(SS)):
  if SS[i]=="?":
    SS[i]="a"

if p==-1:
  print("UNRESTORABLE")
else:
  print("".join(map(str,SS)))

Failing test case input:
@???ct?
dbdnq

Expected output:
UNRESTORABLE


Actual output:
@adbdnq


Fixed submission (verdict: Accepted):
S=list(input())
T=list(input())
p=-1; i=0; e=0
for i in range(len(S)-len(T)+1):
  for j in range(len(T)):
    if S[j+i]==T[j] or S[j+i]=="?":
      e=e+1
      
    else:
      e=0
      break
    if e==len(T):
      p=i
      e=0
    
if p==-1:
  print("UNRESTORABLE")
else:
  S[p:p+len(T)]=T
  for i in range(len(S)):
    if S[i]=="?":
      S[i]="a"
  print("".join(S))

Problem: p03565
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def slove():
    import sys
    input = sys.stdin.readline
    s = list(str(input().rstrip('\n')))
    t = str(input().rstrip('\n'))
    for i in range(len(s) - len(t), -1, -1):
        ts = s[i:i + len(t)]
        b = True
        for j in range(len(t)):
            if ts[j] != "?" and ts[j] != t[j]:
                b = False
                break
        if b:
            for j in range(len(t)):
                s[i + j] = t[j]
            for j in range(len(s)):
                if s[j] == "?":
                    s[j] = "a"
            print("".join(s))
            exit()
        else:
            if s[i] == "?":
                s[i] = "a"
    print("UNRESTORABLE")


if __name__ == '__main__':
    slove()


Failing test case input:
d>>>???q
a`a

Expected output:
d>>>a`aq


Actual output:
UNRESTORABLE


Fixed submission (verdict: Accepted):
def slove():
    import sys
    input = sys.stdin.readline
    s = list(str(input().rstrip('\n')))
    t = str(input().rstrip('\n'))
    for i in range(len(s) - len(t), -1, -1):
        ts = s[i:i + len(t)]
        b = True
        for j in range(len(t)):
            if ts[j] != "?" and ts[j] != t[j]:
                b = False
                break
        if b:
            for j in range(len(t)):
                s[i + j] = t[j]
            for j in range(len(s)):
                if s[j] == "?":
                    s[j] = "a"
            print("".join(s))
            exit()
    print("UNRESTORABLE")


if __name__ == '__main__':
    slove()
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

ans = ''
cond = False

if len(s) < len(t):
    print('UNRESTORABLE')
else:
    for i in range(len(s) - len(t) + 1):
        count = sum(p == '?' for p in s[i:i+len(t)])
        for j in range(len(t)):
            if s[i+j] == t[j]:
                count += 1
        if count == len(t):
            ans += t
            cond = True
        else:
            if s[i] == '?':
                ans += 'a'
            else:
                ans += s[i]
    if cond:
        print(ans)
    else:
        print('UNRESTORABLE')




Failing test case input:
d>>>???q
a`a

Expected output:
d>>>a`aq


Actual output:
d>>>a`aa


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

ans = ['?' for i in range(len(s))]
start_pos = 0
cond = False
count = 0

if len(s) < len(t):
    print('UNRESTORABLE')
else:
    for i in range(len(s) - len(t) + 1):
        for j in range(len(t)):
            if s[i+j] == t[j] or s[i+j] == "?":
                count += 1
        if count == len(t):
            start_pos = i
            cond = True
        count = 0
    if cond:
        ans = list(s)
        for k in range(len(t)):
            ans[start_pos+k] = t[k]
        ans = "".join(ans)
        ans = ans.replace("?", "a")
        print(ans)
    else:
        print('UNRESTORABLE')

Problem: p03565
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
sd = input()
t = input()
oks = []
if len(sd) < len(t):
    print("UNRESTORABLE")
else:
    for i in range(len(sd)-len(t)+1):
        
        sdd = sd[i:i+len(t)]
        f = True
        for j,sddj in enumerate(sdd):
            if sddj == "?":
                continue
            elif sddj != t[j]:
                f = False
                break
        if f:
            oks.append((sd[:i]+t).replace("?","a"))
    oks.sort()
    if oks:
        print(oks[0])
    else:
        print("UNRESTORABLE")


Failing test case input:
>q???d?>
_ba

Expected output:
>q_bada>


Actual output:
>q_ba


Fixed submission (verdict: Accepted):
sd = input()
t = input()
oks = []
if len(sd) < len(t):
    print("UNRESTORABLE")
else:
    for i in range(len(sd)-len(t)+1):
        sdd = sd[i:i+len(t)]
        f = True
        for j,sddj in enumerate(sdd):
            if sddj == "?":
                continue
            elif sddj != t[j]:
                f = False
                break
        if f:
            oks.append(i)
    if oks:
        k = oks[-1]
        print((sd[:k]+t+sd[k+len(t):]).replace("?","a"))
    else:
        print("UNRESTORABLE")
Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
t = input()

res = 'UNRESTORABLE'

for i in range(len(s))[::-1]:
    s_tmp = s[i:]
    if s_tmp[0] == t[0] and len(s_tmp) > len(t):
        if len([True for x in range(len(t)) if s_tmp[x] in ['?', t[x]]]) == len(t):
            res = s[:i].replace('?', 'a') + t + s[i+len(t):].replace('?', 'a')
            break
print(res)

Failing test case input:
?tc????
coder

Expected output:
atcoder

Actual output:
UNRESTORABLE


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

res = []

for s_index in range(len(s)-len(t)+1):
    if s[s_index] in ['?', t[0]]:
        s_p = s[s_index:s_index+len(t)]
        if len([True for x in range(len(s_p)) if s_p[x] in ['?', t[x]]]) == len(t):
            res.append(s[:s_index].replace('?', 'a') + t + s[s_index+len(t):].replace('?', 'a'))

if res:
    print(sorted(res)[0])
else:
    print('UNRESTORABLE')

Problem: p03565
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
T = input()
match = False
start = -1
for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if S[i+j] == T[j] or S[i+j] == "?":
            match = True
    if match:
        start = i
    
    
if start == -1:
    print('UNRESTORABLE')
else:
    result = S[:start] + T + S[start+len(T):]
    print(result.replace("?", "a"))


Failing test case input:
@tc???@
endcq

Expected output:
UNRESTORABLE


Actual output:
@tendcq


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

start = -1
for i in range(len(S)-len(T)+1):
    match = True
    for j in range(len(T)):
        if not (S[i+j] == T[j] or S[i+j] == "?"):
            match = False
    if match:
        start = i


if start == -1:
    print('UNRESTORABLE')
else:
    result = S[:start] + T + S[start+len(T):]
    print(result.replace("?", "a"))
Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
0 -2
1 12

Expected output:
14


Actual output:
36


Fixed submission (verdict: Accepted):
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)

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * W + w * H - h * w)

Failing test case input:
38 0
1 4

Expected output:
-148


Actual output:
148


Fixed submission (verdict: Accepted):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H * W - (h * W + w * H - h * w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import io, sys, atexit, os

import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations


def li ():
	return list (map (int, input ().split ()))


def num ():
	return map (int, input ().split ())


def nu ():
	return int (input ())


def find_gcd ( x, y ):
	while (y):
		x, y = y, x % y
	return x


mm = 1000000007



def solve ():
	t = 1
	for it in range (t):
		a,b=num()
		c,d=num()
		print(a*b-c*d)





if __name__ == "__main__":
	solve ()

Failing test case input:
32 3
-1 1

Expected output:
66


Actual output:
97


Fixed submission (verdict: Accepted):
import io, sys, atexit, os

import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations


def li ():
	return list (map (int, input ().split ()))


def num ():
	return map (int, input ().split ())


def nu ():
	return int (input ())


def find_gcd ( x, y ):
	while (y):
		x, y = y, x % y
	return x


mm = 1000000007



def solve ():
	t = 1
	for it in range (t):
		a,b=num()
		c,d=num()
		ff=c*b+a*d-(c*d)
		print(a*b-ff)





if __name__ == "__main__":
	solve ()

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W =map(int,input().split())
h, w =map(int,input().split())
print(H*W-h-w+1)

Failing test case input:
57 0
0 -1

Expected output:
57


Actual output:
2


Fixed submission (verdict: Accepted):
H, W =map(int,input().split())
h, w =map(int,input().split())
print(H*W-h*W-w*H+h*w)

Problem: p03101
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H*W)-(h*w))

Failing test case input:
21 -1
-3 -3

Expected output:
48


Actual output:
-30


Fixed submission (verdict: Accepted):
H,W = map(int,input().split())
h,w = map(int,input().split())
print((H-h)*(W-w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
c,d=map(int,input().split())
print((a-b)*(c-d))

Failing test case input:
17 -1
0 -3

Expected output:
34


Actual output:
54


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
c,d=map(int,input().split())
print((a-c)*(b-d))
Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
h, w = map(int, input().split())

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

Failing test case input:
2 4
2 4

Expected output:
0

Actual output:
-4


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

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

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

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

Failing test case input:
0 -2
1 12

Expected output:
14


Actual output:
-10


Fixed submission (verdict: Accepted):
H,W = map(int,input().split())
h,w = map(int,input().split())
 
print(H*W-H*w-h*W+h*w)

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = input().split()
h, w = input().split()
print(H, W, h, w)
ans = (int(H) - int(h)) * (int(W) - int(w))
print(ans)


Failing test case input:
22 2
5 1

Expected output:
17


Actual output:
22 2 5 1
17


Fixed submission (verdict: Accepted):
H, W = input().split()
h, w = input().split()
ans = (int(H) - int(h)) * (int(W) - int(w))
print(ans)

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
c, d = map(int, input().split())

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

Failing test case input:
4 0
7 4

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
c, d = map(int, input().split())

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

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * W + H * w - h * w)

Failing test case input:
32 18
0 0

Expected output:
576


Actual output:
0


Fixed submission (verdict: Accepted):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H * W - (h * W + H * w - h * w))

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

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

Failing test case input:
3 2
2 1

Expected output:
1

Actual output:
0


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

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

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

print(W*hi+H*wi-hi*wi)

Failing test case input:
13 2
21 0

Expected output:
-16


Actual output:
42


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

print(W*H-W*hi-H*wi+hi*wi)

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

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

Failing test case input:
59 0
-5 -1

Expected output:
64


Actual output:
52


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

print(H*W - W*h - H*w + h*w)
Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-h*W-w*H+2*h*w)

Failing test case input:
22 -1
1 2

Expected output:
-63


Actual output:
-61


Fixed submission (verdict: Accepted):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-h*W-w*H+h*w)

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = [int(i) for i in input().split()]
c, d = [int(i) for i in input().split()]

print(a*b - c*d)

Failing test case input:
21 -1
-2 -3

Expected output:
46


Actual output:
-27


Fixed submission (verdict: Accepted):
a, b = [int(i) for i in input().split()]
c, d = [int(i) for i in input().split()]

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

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

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


Failing test case input:
7 5
2 2

Expected output:
15


Actual output:
11


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

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

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

def main():
    list = [[i for i in map(int, line.rstrip().split())] for line in sys.stdin.readlines()]
    a = (list[0][0] - list[0][1]) *  (list[1][0] - list[1][1])
    print(a)

if __name__ == '__main__':
    sys.exit(main())



Failing test case input:
32 8
0 1

Expected output:
224


Actual output:
-24


Fixed submission (verdict: Accepted):
import sys

def main():
    list = [[i for i in map(int, line.rstrip().split())] for line in sys.stdin.readlines()]
    a = (list[0][0] - list[1][0]) *  (list[0][1] - list[1][1])
    print(a)

if __name__ == '__main__':
    sys.exit(main())

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

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

Failing test case input:
4 1
3 4

Expected output:
-3


Actual output:
0


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

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

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W = map(int, input().split(" "))
h,w = map(int, input().split(" "))
 
res = (H-h) * (h-w)
print(res)

Failing test case input:
-1 -1
1 12

Expected output:
26


Actual output:
22


Fixed submission (verdict: Accepted):
H, W = map(int,input().split())
h, w = map(int,input().split())
 
print((H-h)*(W-w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print((a[0]-a[1])*(b[0]-b[1]))

Failing test case input:
32 2
0 1

Expected output:
32


Actual output:
-30


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
b=list(map(int,input().split()))
print((a[0]-b[0])*(a[1]-b[1]))
Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-h*H-w*W+h*w)

Failing test case input:
85 0
0 -1

Expected output:
85


Actual output:
0


Fixed submission (verdict: Accepted):
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
hh,ww = map(int, input().split())
h, w = map(int, input().split())
s = hh*ww - h*ww - hh*w + hh*ww
print(s)

Failing test case input:
32 18
0 0

Expected output:
576


Actual output:
1152


Fixed submission (verdict: Accepted):
hh,ww = map(int, input().split())
h, w = map(int, input().split())
s = hh*ww - h*ww - hh*w + h*w
print(s)

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
 
H = HW[0]
W = HW[1]
 
h = hw[0]
w = hw[1]
 
print(H * W - (H * h + (W - h) * w))

Failing test case input:
13 2
21 0

Expected output:
-16


Actual output:
-247


Fixed submission (verdict: Accepted):
HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
H = HW[0]
W = HW[1]
h = hw[0]
w = hw[1]
r = H * W - (W * h + (H - h) * w)
print(r)

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

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

Failing test case input:
29 -1
-2 -3

Expected output:
62


Actual output:
-28


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

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

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split())
a,b=map(int,input().split())
print(a*b-((A-a)*b+(B-b)*a))

Failing test case input:
20 1
4 0

Expected output:
16


Actual output:
-4


Fixed submission (verdict: Accepted):
A,B=map(int,input().split())
a,b=map(int,input().split())
print((A*B)-(a*b+(A-a)*b+(B-b)*a))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split())
C,D=map(int,input().split())
print((A-1)*(B-1)-(C-1)*(D-1))

Failing test case input:
85 1
0 -1

Expected output:
170


Actual output:
-2


Fixed submission (verdict: Accepted):
A,B=map(int,input().split())
C,D=map(int,input().split())
print(A*B-D*A-B*C+D*C)

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

white = int(H * W)
black = int(H*h + W*w)
white = white - black + h*w

print(white)


Failing test case input:
41 8
0 1

Expected output:
287


Actual output:
320


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

white = int(H * W)
black = int(H*w + W*h)
white = white - black + h*w

print(white)
Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(H * W - (h * w))


Failing test case input:
29 -1
-2 -3

Expected output:
62


Actual output:
-35


Fixed submission (verdict: Accepted):
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H - h) * (W - w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h, w = map(int,input().split())
h1, w1 = map(int,input().split())
print(h*w - (w*h1 + h*w1 - h1 - w1 +1))

Failing test case input:
20 1
9 -1

Expected output:
22


Actual output:
38


Fixed submission (verdict: Accepted):
h, w = map(int,input().split())
h1, w1 = map(int,input().split())
print((h-h1)*(w-w1))

Problem: p03101
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
H, W = map(int, input().split())
h, w = map(int, input().split())

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

print(ans)

Failing test case input:
88 1
0 -2

Expected output:
264


Actual output:
90


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

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

print(ans)

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=[int(x)for x in input().split()]
c,d=[int(x)for x in input().split()]
print(a*b-c*d)

Failing test case input:
17 -1
0 -3

Expected output:
34


Actual output:
-17


Fixed submission (verdict: Accepted):
a,b=[int(x)for x in input().split()]
c,d=[int(x)for x in input().split()]
print((a-c)*(b-d))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
32 3
-1 1

Expected output:
66


Actual output:
125


Fixed submission (verdict: Accepted):
a, b = [int(i) for i in input().split()]
c, d = [int(i) for i in input().split()]

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

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(int(H*W-h*w))

Failing test case input:
85 2
2 -1

Expected output:
249


Actual output:
172


Fixed submission (verdict: Accepted):
H,W=map(int,input().split())
h,w=map(int,input().split())
print(int(H*W-h*W-H*w+h*w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W=(int(x) for x in input().split())
h,w=(int(x) for x in input().split())

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

Failing test case input:
7 18
-1 0

Expected output:
144


Actual output:
126


Fixed submission (verdict: Accepted):
H,W=(int(x) for x in input().split())
h,w=(int(x) for x in input().split())

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

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

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


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

Failing test case input:
21 -1
-5 -3

Expected output:
52


Actual output:
73


Fixed submission (verdict: Accepted):

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


if (H, W) == (h, w):
    print(0)
else:
    print(H * W - ((W * h) + (H * w) - (h * w)))
Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W = map(int, input().split())
h, w = map(int, input().split())
print((h-h)*(W-w))

Failing test case input:
-1 0
4 9

Expected output:
45


Actual output:
0


Fixed submission (verdict: Accepted):
H,W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
HW=input()
hw=input()
HWlist=HW.split()
hwlist=hw.split()
print(HWlist)
print(hwlist)
H=int(HWlist[0])
W=int(HWlist[1])
h=int(hwlist[0])
w=int(hwlist[1])
print(H*W-h*W-H*w+h*w)

Failing test case input:
17 -1
-4 1

Expected output:
-42


Actual output:
['17', '-1']
['-4', '1']
-42


Fixed submission (verdict: Accepted):
HW=input()
hw=input()
HWlist=HW.split()
hwlist=hw.split()
H=int(HWlist[0])
W=int(HWlist[1])
h=int(hwlist[0])
w=int(hwlist[1])
print(H*W-h*W-H*w+h*w)

Problem: p03101
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
HW_list =[list(map(int,input().split())) for i in range(2)]
print(HW_list[0][0]*HW_list[0][1]-HW_list[1][0]*HW_list[1][1])

Failing test case input:
59 0
0 -1

Expected output:
59


Actual output:
0


Fixed submission (verdict: Accepted):
HW =[list(map(int,input().split())) for i in range(2)]
print((HW[0][0]-HW[1][0])*(HW[0][1]-HW[1][1]))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
matrix = list(map(int,input().split()))
shitei = list(map(int,input().split()))

masume = matrix[0]*matrix[1]
black = shitei[0]*matrix[1]+shitei[0]*(matrix[0]-shitei[0])
white = masume-black

print(white)

Failing test case input:
35 0
-5 -1

Expected output:
40


Actual output:
200


Fixed submission (verdict: Accepted):
matrix = list(map(int,input().split()))
shitei = list(map(int,input().split()))

masume = matrix[0]*matrix[1]
black = shitei[0]*matrix[1]+shitei[1]*(matrix[0]-shitei[0])
white = masume-black

print(white)

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

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

Failing test case input:
0 1
1 8

Expected output:
7


Actual output:
-1


Fixed submission (verdict: Accepted):
H,W = map(int, input().split())
h,w = map(int, input().split())
 
print(H*W -(h*W+H*w-h*w))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W = map(int,input().split())
h,w = map(int,input().split())
print(int((H*W)-(h*H+w*W - h*w)))

Failing test case input:
0 1
1 11

Expected output:
10


Actual output:
0


Fixed submission (verdict: Accepted):
H,W = map(int,input().split())
h,w = map(int,input().split())
print(int((H*W)-(h*W+w*H - h*w)))

Problem: p03101
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(h * W + H * w - h * w)

Failing test case input:
35 0
-5 -1

Expected output:
40


Actual output:
-40


Fixed submission (verdict: Accepted):
H, W = map(int, input().split())
h, w = map(int, input().split())
print(int((H - h) * (W - w)))