ZhenlongDai/ACPR huggingface dataset:
Problem: p02361
Buggy submission (Python3, verdict: Wrong Answer):


V,E,r = map(int, input().split())
edges = []
for _ in range(E):
    tmp = [int(x) for x in input().split()]
    edges.append(tmp)

d = [float('inf') for _ in range(V)]
d[r] = 0

for _ in range(V-1):
    count = 0
    for x in edges:
        if d[x[1]] > d[x[0]] + x[2]:
            count += 0
            d[x[1]] = d[x[0]] + x[2]
    if count == 0:
        break

for x in d:
    if x == float('inf'):
        print('INF')
    else:
        print(x)


Failing test case input:
4 6 1
0 1 1
0 2 4
2 0 1
1 2 2
3 0 1
3 2 5

Expected output:
3
0
2
INF


Actual output:
INF
0
2
INF


Fixed submission (verdict: Accepted):


V,E,r = map(int, input().split())
edges = []
for _ in range(E):
    tmp = [int(x) for x in input().split()]
    edges.append(tmp)

d = [float('inf') for _ in range(V)]
d[r] = 0

for _ in range(V-1):
    count = 0
    for x in edges:
        s,t,w = x
        if d[t] > d[s] + w:
            count += 1
            d[t] = d[s] + w
    if count == 0:
        break

for x in d:
    if x == float('inf'):
        print('INF')
    else:
        print(x)

Problem: p02361
Buggy submission (Python3, verdict: Wrong Answer):
v,e,s=map(eval,input().split())
edge=[]
inf =1000000100
for i in range(v):
    edge.append([])

for i in range(e):
    vs,vt,d=map(eval,input().split())
    edge[vs].append((vt,d))
    
dis=[]
for i in range(v):
    dis.append(inf)

dis[s]=0

for i in range(v):
    for (t,d) in edge[i]:
        if dis[t]>dis[i]+d:
            dis[t]=dis[i]+d

for i in range(v):
    if dis[i]>=inf:
        print("INF")
    else:
        print(dis[i])

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

Expected output:
0
1
0
INF
INF
INF
INF
INF


Actual output:
0
INF
0
INF
INF
INF
INF
INF


Fixed submission (verdict: Accepted):
v,e,s=map(int,input().split())
edge=[]
inf =1000000100
for i in range(v):
    edge.append([])

for i in range(e):
    vs,vt,d=map(int,input().split())
    edge[vs].append((vt,d))
    
dis=[]
for i in range(v):
    dis.append(inf)

dis[s]=0

for j in range(v):
    update=False
    for i in range(v):
        for (t,d) in edge[i]:
            if dis[i]<inf and d<inf and dis[t]>dis[i]+d:
                dis[t]=dis[i]+d
                update=True
    if update==False: break

for i in range(v):
    if dis[i]>=inf:
        print("INF")
    else:
        print(dis[i])
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

K,S=[int(i) for i in input().split()]
ans=0
for x in range(K+1):
     for y in range(S-x+1):
        if S-x-y<=K:
             ans+=1
print(ans)

Failing test case input:
5 7

Expected output:
27


Actual output:
30


Fixed submission (verdict: Accepted):

K,S=[int(i) for i in input().split()]
ans=0
for x in range(K+1):
     for y in range(min(S-x+1,K+1)):
        if S-x-y<=K:
             ans+=1
print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
data = list(map(int,input().split()))
cou = 0
for i in range(data[0]):
  for j in range(data[0]):
    k = data[1] - i - j - 2
    if 0 <= k and k <= data[0]:
      cou += 1
print(cou)

Failing test case input:
278 24

Expected output:
325


Actual output:
276


Fixed submission (verdict: Accepted):
data = list(map(int,input().split()))
cou = 0
for i in range(data[0] + 1):
  for j in range(data[0] + 1):
    k = data[1] - i - j
    if 0 <= k and k <= data[0]:
      cou += 1
print(cou)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s= map(int,input().split())
ans=0
for y in range(1,k+1):
  for z in range(1,k+1):
    if 0<=s-y-z<=k:
      ans+=1
print(ans)

Failing test case input:
111 72

Expected output:
2701


Actual output:
2556


Fixed submission (verdict: Accepted):
k, s= map(int,input().split())
ans=0
for y in range(k+1):
  for z in range(k+1):
    if 0<=s-y-z<=k:
      ans+=1
print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K,S = list(map(int,input().split()))

count = 0
for x in range(K):
  for y in range(K):
    if S-x-y < K:
      count += 1
        
print(count)


Failing test case input:
3 7

Expected output:
6


Actual output:
0


Fixed submission (verdict: Accepted):
K,S = list(map(int,input().split()))

count = 0
for x in range(K+1):
  for y in range(K+1):
    if S-x-y <= K and S-x-y >= 0:
      count += 1
        
print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split())
cnt = 0
for i in range(k+1):
  if i < s:
    for j in range(k+1):
      if i + j :
        for l in range(k+1):
          if i + j + l == s:
            cnt += 1
print(cnt)

Failing test case input:
110 36

Expected output:
703


Actual output:
701


Fixed submission (verdict: Accepted):
def main():
  k, s = map(int, input().split())
  cnt = 0
  for i in range(k+1):
    for j in range(k+1):
      if 0 <= s - i - j <= k:
        cnt += 1
  print(cnt)

if __name__ == "__main__":
  main()

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
combi = 0
for x in range(K+1):
  for y in range(x, K+1):
    z = S - x - y
    if z >= 0:
      if z <= K:
        combi += 1
print(combi)

Failing test case input:
8 10

Expected output:
57


Actual output:
31


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
combi = 0
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if z >= 0:
      if z <= K:
        combi += 1
print(combi)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K,S = map(int,input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    if S - i - j <= K+1 and S - i - j >= 0:
      cnt += 1
print(cnt)        

Failing test case input:
6 7

Expected output:
33


Actual output:
34


Fixed submission (verdict: Accepted):
K,S = map(int,input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    if S - i - j <= K and S - i - j >= 0:
      cnt += 1
print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S=list(map(int, input().split()))
c=0
for i in range(0, min(K+1, S+1)):
    for j in range(0, min(i+1, K+1)):
        if j<=K and i-j<=K and S-i<=K:
            c+=1
print(c)


Failing test case input:
12 13

Expected output:
102


Actual output:
90


Fixed submission (verdict: Accepted):
K, S=list(map(int, input().split()))
c=0
for i in range(0, min(2*K+1, S+1)):
    for j in range(0, min(K+1,i+1)):
        if j<=K and i-j<=K and S-i<=K:
            c+=1
print(c)

Problem: p03835
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(k+1):
        z = s - i - l
        if z <= k:
            count += 1

print(count) 


Failing test case input:
278 20

Expected output:
231


Actual output:
77841


Fixed submission (verdict: Accepted):
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for l in range(k+1):
        z = s - i - l
        if 0 <= z <= k:
            count += 1

print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = (int(i) for i in input().split())  
print(sum([min(2*a+i-b+1,b-i+1) for i in range(a+1) if 2*a+i-b+1 > 0]))


Failing test case input:
17 4

Expected output:
15


Actual output:
-63


Fixed submission (verdict: Accepted):
a, b = (int(i) for i in input().split())  
print(sum([min(2*a+i-b+1,b-i+1) for i in range(a+1) if min(2*a+i-b+1,b-i+1) > 0]))

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K,S = map(int, input().split())

ans = 0
for i in range(K+1):
    if S-i <= K:
        ans += (S-i)+1
    elif S-i <= 2*K:
        a = (S-i) -K
        ans += (K-a)+1
print(ans)



Failing test case input:
100 50

Expected output:
1326


Actual output:
101


Fixed submission (verdict: Accepted):
K,S = map(int, input().split())

ans = 0
for i in range(K+1):
    for j in range(K+1):
        z = S-(i+j)
        if 0<= z and z <= K:
            ans += 1
print(ans)

Problem: p03835
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
K,S=map(int,input().split())
count=0
for i in range(K+1):
    for j in range(K+1):
        if((S-i-j)<=K+1 and 0<=S-i-j):
            count=count+1
print(count)


Failing test case input:
8 10

Expected output:
57


Actual output:
59


Fixed submission (verdict: Accepted):
K,S=map(int,input().split())
count=0
for i in range(K+1):
    for j in range(K+1):
        if((S-i-j)<=K and 0<=S-i-j):
            count=count+1
print(count)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
  one = 1
else:
  one = 0
for i in range(K+1):
  if (S-i)%2==0 and S%3!=0:
    three +=1

for l in range(K+1):
  for m in range(l+1,K+1):
    for n in range(m+1,K+1):
      if l+m+n == S:
        six +=1
print(one+3*three+6*six)       
 
     

Failing test case input:
100 22

Expected output:
276


Actual output:
393


Fixed submission (verdict: Accepted):
K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)

Problem: p03835
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
limit, target = map(int, input().split(" "))
answer = 0
for i in range(limit + 1):
    for j in range(limit + 1):
        if target - i - j <= limit:
            answer += 1

print(answer)

Failing test case input:
24 13

Expected output:
105


Actual output:
625


Fixed submission (verdict: Accepted):
limit, target = map(int, input().split(" "))
answer = 0
for i in range(limit + 1):
    for j in range(limit + 1):
        if 0 <= target - i - j <= limit:
            answer += 1
            

print(answer)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = [int(i) for i in input().split()]
cnt = 0

for x in range(K+1):
  for y in range(K+1):
    for z in range(S+1-x-y):
      if x + y + z == S:
        cnt += 1
print(cnt)

Failing test case input:
7 13

Expected output:
42


Actual output:
63


Fixed submission (verdict: Accepted):
K, S = [int(i) for i in input().split()]
cnt = 0

for x in range(K+1):
  for y in range(K+1):
    candi_z = S - x - y 
    if 0<= candi_z <= K:
      cnt += 1
      

print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = list(map(int, input().split()))
count = 0
for x in range(0, k + 1):
    for y in range(x, k + 1):
        z = s - x - y
        if (0 <= z and z <= k):
            count+=1
print(count)


Failing test case input:
100 27

Expected output:
406


Actual output:
210


Fixed submission (verdict: Accepted):
k, s = list(map(int, input().split()))
count = 0
for x in range(0, k + 1):
    for y in range(0, k + 1):
        z = s - x - y
        if (0 <= z and z <= k):
            count+=1
print(count)

Problem: p03835
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
k,s = map(int,input().split())
count = 0
for i in range(k+1):
    for j in range(k+1):
        if 0 <= s-i-j <= s:
            count+=1
print(count)

Failing test case input:
5 7

Expected output:
27


Actual output:
30


Fixed submission (verdict: Accepted):
k,s = map(int,input().split())
count = 0
for i in range(k+1):
    for j in range(k+1):
        if 0 <= s-i-j <= k:
            count+=1
print(count)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split())
count = 0
for kx in range(0, k+1):
    for ky in range(0, s-kx+1):
        kz = s - kx -ky
        if 0 <= kz <= k and kx + ky + kz == s:
            count += 1
print(count)


Failing test case input:
7 13

Expected output:
42


Actual output:
63


Fixed submission (verdict: Accepted):
k, s = map(int, input().split())
count = 0
for kx in range(0, k+1):
    for ky in range(0, k+1):
        kz = s - kx -ky
        if 0 <= kz <= k and kx + ky + kz == s:
            count += 1
print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k,s=map(int,input().split())
x=0
m=min(s+1,k+1)
for a in range(m):
  for b in range(m):
    if a+b>s or a+b<s-k:
      break
    x+=1
print(x)

Failing test case input:
6 7

Expected output:
33


Actual output:
27


Fixed submission (verdict: Accepted):
k,s=map(int,input().split())
x=0
m=min(s+1,k+1)
for a in range(m):
  for b in range(m):
    if a+b>s or a+b<s-k:
      continue
    x+=1
print(x)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = [int(x) for x in input().split()]
cnt = 0
for x in range(k + 1):
    for y in range(x, k + 1):
        for z in range(y, k + 1):
            if x + y + z == s:
                if x == y == z:
                    cnt += 1
                elif x == y or y == z:
                    cnt += 3
                else:
                    cnt += 3
print(cnt)


Failing test case input:
100 58

Expected output:
1770


Actual output:
930


Fixed submission (verdict: Accepted):
k, s = [int(x) for x in input().split()]
cnt = 0
for x in range(k + 1):
    if x > s:
        continue
    for y in range(x, k + 1):
        if y > s:
            break
        z = s - x - y
        if y <= z and z <= k:
            if x + y + z == s:
                if x == y == z:
                    cnt += 1
                elif x == y or y == z:
                    cnt += 3
                else:
                    cnt += 6
print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    k = S - i -j
    if 0 <= k and k <= S:
      cnt += 1
print(cnt)



Failing test case input:
6 7

Expected output:
33


Actual output:
34


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    k = S - i -j
    if 0 <= k and k <= K:
      cnt += 1
print(cnt)

Problem: p03835
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
k,s=map(int,input().split())
ans=0
for i in range(k+1):
	for j in range(k+1-i):
		if 0<=s-(i+j) and s-(i+j)<=k:
			ans+=1
print(ans)

Failing test case input:
12 13

Expected output:
102


Actual output:
90


Fixed submission (verdict: Accepted):
k,s=map(int,input().split())
ans=0
for i in range(k+1):
	for j in range(k+1):
		if 0<=s-(i+j) and s-(i+j)<=k:
			ans+=1
print(ans)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
[k, s] = [int(s) for s in input().split(' ')]
count = 0
for x in range(max(s-2*k, 0), k+1):
    count += min(s-x, 2*k-(s-x)) + 1

print(count)


Failing test case input:
100 22

Expected output:
276


Actual output:
-2727


Fixed submission (verdict: Accepted):
[k, s] = [int(s) for s in input().split(' ')]
count = 0
for x in range(max(s-2*k, 0), min(k,s)+1):
    count += min(s-x, 2*k-(s-x)) + 1

print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
K,S = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
for X in range(0,K+1):
    for Y in range(0,K+1):
            if S-(X+Y) <= K:
                ans += 1
print(ans)

Failing test case input:
110 28

Expected output:
435


Actual output:
12321


Fixed submission (verdict: Accepted):
from sys import stdin
K,S = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
for X in range(0,K+1):
    for Y in range(0,K+1):
            if 0 <= S-(X+Y) <= K:
                ans += 1
print(ans)

Problem: p03835
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=input().split()
a=int(a)
b=int(b)
c=0
for i in range(b+1):
  for k in range(b+1):
    if a<=i+k<=a+b:
      c=c+1
print(c)

Failing test case input:
4 7

Expected output:
18


Actual output:
48


Fixed submission (verdict: Accepted):
a,b=input().split()
a=int(a)
b=int(b)
c=0
for i in range(a+1):
  for k in range(a+1):
    if b-a<=i+k<=b:
      c=c+1
print(c)

Problem: p03835
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
K,S=map(int, input().split(' '))

count = 0
for i in range(K+1):
    for j in range(K+1):
        if S-(i+j) <= K:
            count += 1

print(count)


Failing test case input:
5 5

Expected output:
21


Actual output:
36


Fixed submission (verdict: Accepted):
K,S=map(int, input().split(' '))

count = 0
for i in range(K+1):
    for j in range(K+1):
        k = S-(i+j)
        if 0<= k <= K:
            count += 1

print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split())
cnt = 0
for i in range(s+1):
  for j in range(s-i+2):
    for l in range(s-j-k+3):
      if i + j + l == s:
        cnt += 1
print(cnt)

Failing test case input:
-12 1

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
def main():
  k, s = map(int, input().split())
  cnt = 0
  for i in range(k+1):
    for j in range(k+1):
      if 0 <= s - i - j <= k:
        cnt += 1
  print(cnt)

if __name__ == "__main__":
  main()

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
 
count = 0
for x in range(K+1):
  
  for y in range(K-x+1):
    
    z = K - x - y
    
    if (x>=0) and (y>=0) and (z>=0):
      count += 1
      
print(count)

Failing test case input:
100 27

Expected output:
406


Actual output:
5151


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
 
count = 0

for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if (z>=0) and (z<=K):
      count += 1

print(count)
Problem: p03835
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
K,S = map(int,input().split())

cnt = 0

for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z <= K:
            cnt +=1
print(cnt)

Failing test case input:
111 72

Expected output:
2701


Actual output:
12544


Fixed submission (verdict: Accepted):
K,S = map(int,input().split())

cnt = 0

for x in range(K+1):
    for y in range(K+1):
        z = S - (x+y)
        if (0 <= z <= K) & (x + y + z == S):
            cnt +=1
print(cnt)

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

if __name__ == '__main__':
    b, c = map(int, input().split())
    num = b*3 -c
    if num == 0 or c ==0:
        num =1
    else:
        if num > b:
            num = c*3
        else:
            num = num*3
    print(num)




Failing test case input:
100 22

Expected output:
276


Actual output:
66


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    b, c = map(int, input().split())
    num = b*3 -c

    count = 0
    for i in range (0,b+1):
        for j in range(0,b+1):
            if c-(i+j)<=b and c-(i+j) >=0:
                count+=1
    print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k,s=[int(i) for i in input().split()]
c=0
for i in range(k+1):
    for j in range(k+1):
        l=k-(i+j)
        if(0<=l<=k and i+j+k==s):
            c+=1
print(c)



Failing test case input:
5 9

Expected output:
25


Actual output:
5


Fixed submission (verdict: Accepted):
k,s=[int(i) for i in input().split()]
c=0
for i in range(k+1):
    for j in range(k+1):
        l=s-(i+j)
        if(0<=l<=k):
            c+=1
print(c)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
res = 0
for x in range(K+1):
    m = S-x
    if m == 0:
        res += 1
    if (m > 0 and m < 2*K):
        res += m + 1
    if m == 2*K:
        res += 1
print(res)

Failing test case input:
8 10

Expected output:
57


Actual output:
63


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
res = 0
for X in range(0, K+1):
    for Y in range(0, K+1):
            total = X + Y
            if S - total >=0 and S - total <= K:
                res += 1
print(res)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ks= list(map(int, input().split())) 

count = 0

x = 0
y = 0
z = 0

for targetX in range(ks[1]+1):
    
    for targetY in range(ks[1]+1):
    
        for targetZ in range(ks[1]+1):
        
            if targetZ <= ks[0] and 0 <= targetX:
                if targetX + targetY + targetZ == ks[1]:
                
                    count +=1
                    
                    
                    
            
            targetZ +=1
    
        targetY +=1
        
    targetX +=1
        


print(count)


Failing test case input:
7 13

Expected output:
42


Actual output:
84


Fixed submission (verdict: Accepted):
ks= list(map(int, input().split())) 
 
count = 0
 
x = 0
y = 0
z = 0
 
for targetX in range(ks[0]+1):
    
    
    if targetX <= ks[0] and ks[1]-(targetX+ks[0]+ks[0]) <= 0:
    
        for targetY in range(ks[0]+1):
            
            z = ks[1] - (targetX + targetY)
            
            if 0 <= z and z <= ks[0]:
                count += 1
                
        
        
        
 
print(count)

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



K,S = map(int,input().split())
result =0

for x in range(K+1):
    for y in range(K - x + 1):
        for z in range(K-x-y+1):
            if x+y+z == S:
                result += 1

print(result)

Failing test case input:
5 15

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):



K,S = map(int,input().split())
result =0

for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
            result += 1

print(result)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())

cnt = 0

for i in range(K+1):
    for j in range(K+1):
        z = S - i - j
        if S == z:
            cnt += 1

print(cnt)

Failing test case input:
3 7

Expected output:
6


Actual output:
1


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())

cnt = 0

for i in range(K+1):
    for j in range(K+1):
        z = S - i - j
        if 0 <= z <= K:
            cnt += 1

print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K = 2
S = 2
count = 0

for x in range(K):
  for y in range(K):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
        
print(count)

Failing test case input:
278 20

Expected output:
231


Actual output:
4


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
(k, s) = list(map(int, input().split()))
count = 0
kmin = int(s / 3)
for x in range(kmin, k + 1):
    for y in range(kmin, k + 1):
        z = s - x - y
        if z >= 0 and z <= k:
            count += 1
print(count)

Failing test case input:
6 7

Expected output:
33


Actual output:
10


Fixed submission (verdict: Accepted):
(k, s) = list(map(int, input().split()))
count = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - x - y
        if z >= 0 and z <= k:
            count += 1
print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
m=0
for i in range(K):
  for j in range(K):
    if 0<=S-i-j<=K:
      m+=1
print(m)

Failing test case input:
5 5

Expected output:
21


Actual output:
19


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
m=0
for i in range(K+1):
  for j in range(K+1):
    if 0<=S-i-j<=K:
      m+=1
print(m)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int,input().split())

ans = 0
for x in range(K):
    sum_y_z = S - x 
    if sum_y_z <= 2 * K: 
        ans += sum_y_z + 1
ans += 1 

print(str(ans))


Failing test case input:
100 58

Expected output:
1770


Actual output:
951


Fixed submission (verdict: Accepted):


K, S = map(int,input().split())

ans = 0
for x in range(K + 1):
    for y in range(K + 1):
        z = S - (x + y)
        if (z >= 0) and (z <= K):
            ans += 1

print(str(ans))

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == '__main__':
    b, c = map(int, input().split())
    num = b*3 -c
    if num == 0:
        num =1
    else:
        if num > b:
            num = b*3
        else:
            num = num
    print(num)




Failing test case input:
4 7

Expected output:
18


Actual output:
12


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    b, c = map(int, input().split())
    num = b*3 -c

    count = 0
    for i in range (0,b+1):
        for j in range(0,b+1):
            if c-(i+j)<=b and c-(i+j) >=0:
                count+=1
    print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k,s=[int(i) for i in input().split()]
c=0
for i in range(k+1):
    for j in range(k+1):
        l=k-(i+j)
        if(0<=l<=k and i+j+l==s):
            c+=1
print(c)



Failing test case input:
111 72

Expected output:
2701


Actual output:
0


Fixed submission (verdict: Accepted):
k,s=[int(i) for i in input().split()]
c=0
for i in range(k+1):
    for j in range(k+1):
        l=s-(i+j)
        if(0<=l<=k):
            c+=1
print(c)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = [2500,7500]

x = [ i   for i in range(n[0]+1)]



counter = 0
if n[0]*3 >= n[1]:
  for x1 in x:
    for y1 in x:
      if 0<= n[1]-x1-y1 <=n[0]  :
          counter +=1

        
print(counter)        


Failing test case input:
111 72

Expected output:
2701


Actual output:
1


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


x = [ i   for i in range(n[0]+1)]



counter = 0
if n[0]*3 >= n[1]:
  for x1 in x:
    for y1 in x:
      if 0<= n[1]-x1-y1 <=n[0]  :
          counter +=1

        
print(counter)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split())
arr = [[x, y, s-x-y] for x in range(k+1) for y in range(k+1) if k >= s-x-y > 0]
print(len(arr))

Failing test case input:
4 7

Expected output:
18


Actual output:
16


Fixed submission (verdict: Accepted):
k, s = map(int, input().split())
arr = [1 for x in range(k+1) for y in range(k+1) if k >= s-x-y >= 0]
print(sum(arr))

Problem: p03835
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
k,s=map(int,input().split())
t=0

for i in range(k+1):
    for j in range(k+1):
        l=s-i-j
        if i+j+l==s:
            t+=1
print(t)


Failing test case input:
3 7

Expected output:
6


Actual output:
16


Fixed submission (verdict: Accepted):
k,s=map(int,input().split())
t=0

for i in range(k+1):
    for j in range(k+1):
        l=s-i-j
        if 0<=l<=k:
            t+=1
print(t)

Problem: p03835
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
k, s = map(int, input().split())
ans = 0
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if z <= k and z:
      ans += 1
print(ans)


Failing test case input:
5 9

Expected output:
25


Actual output:
24


Fixed submission (verdict: Accepted):
k, s = map(int, input().split())
ans = 0
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if z <= k and z >= 0:
      ans += 1
print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
res = 0
for x in range(K+1):
    m = S-x
    if (m == 0 or m == 2*K):
        res += 1
    elif (m > 0 and m < 2*K):
        res += m + 1
print(res)

Failing test case input:
3 7

Expected output:
6


Actual output:
12


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
res = 0
for X in range(0, K+1):
    for Y in range(0, K+1):
            total = X + Y
            if S - total >=0 and S - total <= K:
                res += 1
print(res)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = tuple(map(int, input().split()))

ret = 0 
for X in range(K+1):
  for Y in range(X, K+1):
    Z = S - X - Y
    if Z < Y: break
    if Z >= 0 and Z <= K:
      print(X, Y, Z)
      if X == Y and Y == Z: ret += 1
      elif X != Y and Y != Z and Z != X: ret += 6
      else: ret += 3

print (ret)

Failing test case input:
7 13

Expected output:
42


Actual output:
0 6 7
1 5 7
1 6 6
2 4 7
2 5 6
3 3 7
3 4 6
3 5 5
4 4 5
42


Fixed submission (verdict: Accepted):
K, S = tuple(map(int, input().split()))

ret = 0 
for X in range(K+1):
  for Y in range(X, K+1):
    Z = S - X - Y
    if Z < Y: break
    if Z >= 0 and Z <= K:
      if X == Y and Y == Z: ret += 1
      elif X != Y and Y != Z and Z != X: ret += 6
      else: ret += 3

print (ret)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
    for j in range(K-i+1):
        if S - i - (K - j) <= K:
            cnt += 1
            break
print(cnt)


Failing test case input:
5 7

Expected output:
27


Actual output:
6


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - i - j <= K:
            cnt += 1
print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k,s=map(int,input().split())
cnt=0
for x in range(k+1):
  for y in range(k+1):
    z=s-x-y
    if z>=0 and z<=2500:
      cnt+=1
        
print(cnt)

Failing test case input:
4 7

Expected output:
18


Actual output:
24


Fixed submission (verdict: Accepted):
k,s=map(int,input().split())
cnt=0
for x in range(k+1):
  for y in range(k+1):
    z=s-x-y
    if z>=0 and z<=k:
      cnt+=1
        
print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())

count = 0

x = 0
while (x <= K):
    y = 0
    while (y + x <= K):
        z = 0
        while (z + y <= K):
            if x + y + z == S:
                count += 1
            z += 1
        y += 1
    x += 1

print(count)

Failing test case input:
5 9

Expected output:
25


Actual output:
3


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())

count = 0

x = 0
while (x <= K):
    y = 0
    while (y <= K):
        if 0 <= S - (x + y) <= K:
            count += 1
        y += 1
    x += 1



print(count)

Problem: p03835
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
K, S = list(map(int, input().split()))
ct = 0
for a in range(K+1):
    for b in range(K+1):
        if 0 <= a+b <= min(S,3*K-S):
            ct += 1
print(ct)

Failing test case input:
12 13

Expected output:
102


Actual output:
103


Fixed submission (verdict: Accepted):
K, S = list(map(int, input().split()))
ct = 0
for a in range(K+1):
    for b in range(K+1):
        if S-K <= a+b <= S:
            ct += 1
print(ct)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

input_lines=input().split()
K = int(input_lines[0])
S = int(input_lines[1])
M=0
for i in range(K+1):
  for j in range(i,K+1):
    k =S-i-j
    if k >K:
      break
    if j>k:
      break
    if k<0:
      break
    if i==j==k:
      M+=1
    elif i==j or j==k:
      M+=3
    else:
      M+=6
print(M)

Failing test case input:
8 10

Expected output:
57


Actual output:
36


Fixed submission (verdict: Accepted):

input_lines=input().split()
K = int(input_lines[0])
S = int(input_lines[1])
M=0
for i in range(K+1):
  for j in range(i,K+1):
    k =S-i-j
    if i<=j<=k<=K:
      if i==j==k:
        M+=1
      elif i==j or j==k:
        M+=3
      else:
        M+=6
print(M)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int, input().split())
count = 0
for i in range(a+1):
  for j in range(a+1):
    s = b-i-j
    if s <= a:
      count += 1
print(count)

Failing test case input:
278 20

Expected output:
231


Actual output:
77841


Fixed submission (verdict: Accepted):
a,b=map(int, input().split())
count = 0
for i in range(a+1):
  for j in range(a+1):
    s = b-i-j
    if s>=0 and s<=a:
      count += 1
print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f(K, S):
    num=0
    for a in range(K+1):
      if S-a>=0 and S-a<=2*K:
        if S-a<=K:
          num+=S-a+1
        else:
          num+=min((S-a)-K,K)+1
    return num

  
K,S=(int(x) for x in input().split())
print(f(K,S))



Failing test case input:
12 13

Expected output:
102


Actual output:
92


Fixed submission (verdict: Accepted):
def f(K, S):
    num=0
    for a in range(K+1):
      if S-a>=0 and S-a<=2*K:
        if S-a<=K:
          num+=S-a+1
        else:
          num+=(K-((S-a)-K))+1
    return num

  
K,S=(int(x) for x in input().split())
print(f(K,S))

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())

cnt = 0
for x in range(K):
  for y in range(K):
    z = S-x-y
    if 0 <= z and z <= K:
      cnt+=1

print(cnt)

Failing test case input:
5 5

Expected output:
21


Actual output:
19


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())

cnt = 0
for x in range(K+1):
  for y in range(K+1):
    z = S-x-y
    if 0 <= z and z <= K:
      cnt+=1

print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
  for y in range(K+1):
    if S-x-y <= K: ans += 1
    
print(ans)

Failing test case input:
110 28

Expected output:
435


Actual output:
12321


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
  for y in range(min(S-x, K)+1):
    if S-x-y <= K: ans += 1
    
print(ans)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split())
result = [i_1+i_2 for i_1 in range(k+1) for i_2 in range(k+1) if 0<=s-i_1+i_2<=k]
print(len(result))

Failing test case input:
7 13

Expected output:
42


Actual output:
3


Fixed submission (verdict: Accepted):
k, s = map(int, input().split())
result = [i_1+i_2 for i_1 in range(k+1) for i_2 in range(k+1) if 0<=s-i_1-i_2<=k]
print(len(result))

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split(" "))

count = 0
for i in range(k+1):
    for j in range(k+1-i):
        for l in range(k+1-i-j):
            if i+j+l == s:
                count += 1
print(count)

Failing test case input:
5 7

Expected output:
27


Actual output:
0


Fixed submission (verdict: Accepted):
k, s = map(int, input().split(" "))

count = 0
for x in range(k+1):
    for y in range(k+1):
        z = s-x-y
        if 0 <= z <= k:
            count += 1

print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
    for y in range(K+1-x):
        for z in range(K+1-x-y):
            if x+y+z == S:
                ans += 1

print(ans)


Failing test case input:
5 7

Expected output:
27


Actual output:
0


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())

ans = 0
for x in range(K+1):
    for y in range(K+1):
        if S-x-y >= 0 and S-x-y <= K:
            ans += 1

print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l     = input().split()
K, S  = map(int, l)
max   = K+1
count = 0


for x in range(max):
    for y in range(max):
            z = S - x - y
            if z <= K :
                count +=1

print(count)

Failing test case input:
011 11

Expected output:
78


Actual output:
144


Fixed submission (verdict: Accepted):
l     = input().split()
K, S  = map(int, l)
max   = K+1
count = 0
z     =	0

for x in range(0, max):
    for y in range(0, max):
            z = S - x - y
            if 0 <= z <= K :
                count +=1

print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    K, S = map(int, input().split())
    ans = 0
    for X in range(K + 1):
        for Y in range(K + 1):
            Z = S - X - Y
            if S >= 0 and S <= K:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()


Failing test case input:
100 50

Expected output:
1326


Actual output:
10201


Fixed submission (verdict: Accepted):
def main():
    K, S = map(int, input().split())
    ans = 0
    for X in range(K + 1):
        for Y in range(K + 1):
            Z = S - X - Y
            if Z >= 0 and Z <= K:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
wariate = 0

for x in range(0, K + 1):
    if S - x <= K:
        wariate += S - x + 1
    elif S - x <= 2 * K:
        wariate += 2 * K - (S - x) + 1

print(wariate)

Failing test case input:
278 20

Expected output:
231


Actual output:
-32922


Fixed submission (verdict: Accepted):

K, S = map(int, input().split())
wariate = 0

for x in range(0, K + 1):
    if S - x <= K:
        wariate += max(S - x + 1, 0)
    else:
        wariate += max(0, 2 * K - (S - x) + 1)

print(wariate)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = list(map(int,input().split()))
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y
    if X + Y + Z == S:
        count += 1
print(count)

Failing test case input:
5 9

Expected output:
25


Actual output:
36


Fixed submission (verdict: Accepted):
K, S = list(map(int,input().split()))
count = 0

for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y 

    if 0 <= Z and Z <= K:
        count += 1
print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    ans = 0
    k, s = map(int, input().split())
    list_ = list(range(s+1))

    for i in range(k+1):
        for j in range(k+1):
            if i + j - s in list_:
                ans += 1

    print(ans)

if __name__ == '__main__':
    main()


Failing test case input:
7 13

Expected output:
42


Actual output:
3


Fixed submission (verdict: Accepted):
def main():
    ans = 0
    k, s = map(int, input().split())

    for i in range(k+1):
        for j in range(k+1):
            if 0 <=  s - (i + j) <= k:
                ans += 1

    print(ans)

if __name__ == '__main__':
    main()

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    k = S - i -j
    if k <= 0 and S <= k:
      cnt += 1
print(cnt)



Failing test case input:
6 7

Expected output:
33


Actual output:
0


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
  for j in range(K+1):
    k = S - i -j
    if 0 <= k and k <= K:
      cnt += 1
print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K,S = list(map(int,input().split()))

count = 0
for x in range(K):
  for y in range(K):
    if S-x-y < K and S-x-y >= 0:
      count += 1
        
print(count)


Failing test case input:
12 13

Expected output:
102


Actual output:
96


Fixed submission (verdict: Accepted):
K,S = list(map(int,input().split()))

count = 0
for x in range(K+1):
  for y in range(K+1):
    if S-x-y <= K and S-x-y >= 0:
      count += 1
        
print(count)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int, input().split())
count = 0
for i in range(K+1):
  for j in range(K+1):
    if i + j <= S:
      count += 1
print(count)

Failing test case input:
5 15

Expected output:
1

Actual output:
36


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())
count = 0
for i in range(K+1):
  for j in range(K+1):
    if S - (i + j) <= K and S - (i + j) >= 0:
      
      count += 1
print(count)

Problem: p03835
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
K, S = map(int, input().split())

count = 0
for x in range(K+1):
  for y in range(K+1):
    z = S - (x + y)
    if z >= 0:
      count += 1

print(count)

Failing test case input:
5 7

Expected output:
27


Actual output:
30


Fixed submission (verdict: Accepted):
K, S = map(int, input().split())

count = 0
for x in range(K+1):
  for y in range(K+1):
    z = S - (x + y)
    if z >= 0 and z <= K:
      count += 1

print(count)

Problem: p03835
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a = list(map(int,input().split()))
c=0
for i in range(a[1]-2*a[0] if a[1]-2*a[0] > 0 else 0, a[0]+1):
    c += (2*a[0]-(a[1]-i)) +1 if a[0] > (2*a[0]-(a[1]-i)) else a[1] - i + 1

print(c)


Failing test case input:
110 28

Expected output:
435


Actual output:
-2886


Fixed submission (verdict: Accepted):
a = list(map(int,input().split()))
c=0
for i in range(a[1]-2*a[0] if a[1]-2*a[0] > 0 else 0, a[0]+1):
    for j in range((a[1]-i)-a[0] if (a[1]-i)-a[0] > 0 else 0, a[0] + 1):
        if i + j <= a[1]:
            c += 1

print(c)

Problem: p03835
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
k,s=map(int,input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x -y
        if z<0:
            break
        else:
            ans +=1
        
print(ans)                

Failing test case input:
6 7

Expected output:
33


Actual output:
34


Fixed submission (verdict: Accepted):
k,s=map(int,input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x -y
        if 0<=z<=k:
            ans +=1
        
print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k,s=map(int,input().split())
ans = 0
for i in range(1,k+1):
  for j in range(1,k+1):
    if s-i-j<=k:
      ans+=1
print(ans)

Failing test case input:
278 24

Expected output:
325


Actual output:
77284


Fixed submission (verdict: Accepted):
k,s=map(int,input().split())
ans = 0
for i in range(k+1):
  for j in range(k+1):
    if 0<=s-i-j<=k:
      ans+=1
print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
K, S = map(int, input().split(" "))
l = [i for i in range(K + 1)]
cnt = 0
for x, y in itertools.combinations_with_replacement(l, 2):
    z = S - (x + y)
    if 0 <= z <= K:
        cnt += 1
print(cnt)

Failing test case input:
111 79

Expected output:
3240


Actual output:
1640


Fixed submission (verdict: Accepted):
K, S = map(int, input().split(" "))
cnt = 0
for x in range(K + 1):
    for y in range(K + 1):
        z = S - (x + y)
        if 0 <= z <= K:
            cnt += 1
print(cnt)
Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split(" "))
answer = 0

for i in range(k + 1):
    for j in range(k + 1):
        rem = 3 * k - i - j
        if 0 <= rem <= k:
            answer += 1
print(answer)


Failing test case input:
100 22

Expected output:
276


Actual output:
1


Fixed submission (verdict: Accepted):
k, s = map(int, input().split(" "))
answer = 0

for i in range(k + 1):
    for j in range(k + 1):
        rem = s - i - j
        if 0 <= rem <= k:
            answer += 1
print(answer)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k,s = map(int, input().split())
cnt=0
for x in range(k):
  for y in range(k):
    z = s-x-y
    if 0<=z and z<=k:
      cnt+=1
print(cnt)


Failing test case input:
4 7

Expected output:
18


Actual output:
10


Fixed submission (verdict: Accepted):
k,s = map(int, input().split())
cnt=0
for x in range(k+1):
  for y in range(k+1):
    z = s-x-y
    if 0<=z and z<=k:
      cnt+=1
print(cnt)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split())

ans = 0

for z in range(k + 1):
	if k >= s - z:
		ans += s - z + 1
	elif 2 * (k + 1) > s - z + 1:
		ans += 2 * k - s + z + 1

print(ans)

Failing test case input:
110 36

Expected output:
703


Actual output:
-1998


Fixed submission (verdict: Accepted):
k, s = map(int, input().split())

ans = 0

for x in range(k + 1):
	for y in range(k + 1):
		if 0 <= s - (x + y) <= k:
			ans += 1

print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k, s = map(int, input().split())
count = 0
for kx in range(0, k+1):
    for ky in range(0, s-kx):
        kz = s - kx -ky
        if 0 <= kz <= k and kx + ky + kz == s:
            count += 1
print(count)

Failing test case input:
011 11

Expected output:
78


Actual output:
66


Fixed submission (verdict: Accepted):
k, s = map(int, input().split())
count = 0
for kx in range(0, k+1):
    for ky in range(0, k+1):
        kz = s - kx -ky
        if 0 <= kz <= k and kx + ky + kz == s:
            count += 1
print(count)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k , s = map(int, input().split())

ans = 0

for x in range(k+1):
  for y in range(k+1):
      if s-x-y <= k:
        ans += 1
        
print(ans)

Failing test case input:
5 7

Expected output:
27


Actual output:
33


Fixed submission (verdict: Accepted):
k , s = map(int, input().split())

ans = 0

for x in range(k+1):
  for y in range(k+1):
      if s-x-y <= k and s-x-y>=0:
        ans += 1
        
print(ans)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K, S = map(int,input().split())
import itertools

ar = itertools.product(range(K+1), repeat=2)

ans = 0
for a,b in ar:
  if S - a-b <= K and S-a-b >= K: ans += 1

print(ans)


Failing test case input:
5 5

Expected output:
21


Actual output:
1


Fixed submission (verdict: Accepted):
K, S = map(int,input().split())
import itertools

ar = itertools.product(range(K+1), repeat=2)

ans = 0
for a,b in ar:
  if S - a-b <= K and a+b <= S: ans += 1

print(ans)
Problem: p03835
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
k,s = map(int, input().split())
ans = 0
for x in range(k+1):
    if x>s:
        break
    for y in range(k+1):
        if x+y<=s:
            ans += 1
        if x+y>s:
            break
print(ans)


Failing test case input:
6 7

Expected output:
33


Actual output:
34


Fixed submission (verdict: Accepted):
k,s = map(int, input().split())
ans = 0
for x in range(k+1):
    if x>s:
        break
    for y in range(k+1):
        if x+y<=s and s-(x+y)<=k:
            ans += 1
        if x+y>s:
            break
print(ans)

Problem: p03835
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
r,g=map(int,input().split())
X=0
for i in range(g+1):
  for j in range(g+1):
    k=g-i-j
    if k>=0 and k<=g:
      X+=1
print(X)


Failing test case input:
5 15

Expected output:
1

Actual output:
136


Fixed submission (verdict: Accepted):
r,g=map(int,input().split())
X=0
for i in range(r+1):
  for j in range(r+1):
    k=g-i-j
    if k>=0 and k<=r:
      X+=1
print(X)

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
K , S = map(int , input().split())
ans = 0

for x in range(K):
    for y in range(K):
        if x + y + (S-(x+y)) == S:
            ans += 1
ans += ans/2
print(ans)

Failing test case input:
3 7

Expected output:
6


Actual output:
13.5


Fixed submission (verdict: Accepted):
K , S = map(int , input().split())
ans = 0

for x in range(K+1):
    for y in range(K+1):
        if 0 <= S-(x+y) <= K:
            ans += 1
print(ans)

Problem: p03835
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
	K,S = map(int,input().split())
	ans = 0
	ListK = [i+1 for i in range(K)]
	for x in ListK:
		for y in ListK:
			if S - (x + y) <= K:
				ans += 1

if __name__ == '__main__':
	main()

Failing test case input:
7 13

Expected output:
42


Actual output:

Fixed submission (verdict: Accepted):
def main():
	K,S = map(int,input().split())
	ans = 0
	ListK = [i for i in range(K+1)]
	for x in ListK:
		for y in ListK:
			if 0 <= S - (x + y) <= K:
				ans += 1
	print(ans)

if __name__ == '__main__':
	main()

Problem: p03835
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
k,s=[int(i) for i in input().split()]
c=0
for i in range(k+1):
    for j in range(k+1):
        l=k-(i+j)
        if(0<=l<=k):
            c+=1
print(c)



Failing test case input:
110 36

Expected output:
703


Actual output:
6216


Fixed submission (verdict: Accepted):
k,s=[int(i) for i in input().split()]
c=0
for i in range(k+1):
    for j in range(k+1):
        l=s-(i+j)
        if(0<=l<=k):
            c+=1
print(c)

Problem: p03835
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
k,s=map(int,input().split())

c=0
m=min(s,k)
for x in range(m+1):
  for y in range(m+1):
    if s<x+y:
      break
    else:
      c+=1
print(c)

Failing test case input:
7 13

Expected output:
42


Actual output:
63


Fixed submission (verdict: Accepted):
k,s=map(int,input().split())
 
c=0
m=min(s,k)
for x in range(m+1):
  for y in range(m+1):
    if s<x+y:
      break
    elif s>x+y+k:
      continue
    else:
      c+=1
print(c)