TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s=map(int,input().split())
res=0
for x in range(k+1):
  for y in range(k+1):
    if s-x-y=>0:
      res+=1
print(res)

k,s=map(int,input().split())
res=0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z==s:
        res+=1

k,s=map(int,input().split())
res=0
for x in range(k+1):
  for y in range(k+1):
    if s-x-y<=k and s-x-y>=0:
      res+=1
      #print(x,y,s-x-y)
print(res)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K,S = map(int,input().split())
cnt = 0
for i in range(K + 1):
    for j in range(K + 1):
        if i + j > S:
            continue
        elif i + j == S - K:
            cnt += 1
print(cnt)

k,s = map(int,input().split())
total = 0
for i in range(k+1):
    for j in range(k+1):
        if (i+j > s) or (s-i-j > k):
            continue
        else:
            total += 1
print(total)


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
import sys
input = sys.stdin.readline

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

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

print(count)


import sys
input = sys.stdin.readline

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

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

print(count)


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s=map(int,input().split())
cnt=0
for x in range(k):
  for y in range(k-x):
    for z in range(k-x-y):
      if x+y+z==s:
        cnt+=1
print(cnt)

k,s=map(int,input().split())
cnt=0
ans=0
for i in range(k+1):
  for j in range(k+1):
    for k in range(k+1):
      ans=i+j+k
      if ans=s:
        cnt+=1
print(cnt)

k,s=map(int,input().split())
print(sum(0<=s-x-y<=k for x in range(k+1) for y in range(k+1)))


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = map(int, input().split())
ans = 0
for x in range(k):
    for y in range(k):
        z = s-x-y
        if k >= z >= 0:
            ans += 1
print(ans)

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 k >= z >= 0:
            ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())
cnt = 0
for x in range(K+1):
    for y in range(min(K,S-x+1)):
        z = S - x - y
        if z <= K:
            cnt += 1
print(cnt)

K, S = map(int, input().split())
cnt = 0
for x in range(K+1):
    for y in range(min(K,S-x)+1):
        z = S - x - y
        if z <= K:
            cnt += 1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())
Y = 0

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

print(Y)

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

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

print(Y)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = list(map(int, input().split()))
xyz_l = []
r_k = range(k+1)[::-1]

for x in r_k:
    a = s-x
    if a > k*2:
        break
    for y in r_k:
        b = a - y
        if b > k:
            break
        else:
            z = b - y
            xyz_l.append([x, y, z])
print(len(xyz_l))


k, s = list(map(int, input().split()))
count = int(0)

for x in range(k+1)[::-1]:
    yz = s - x
    if yz > k*2:
        break
    for y in range(k+1)[::-1]:
        z = yz - y
        if x >= y >= z >= 0:
            if len({x, y, z}) == 1:
                count += 1
            elif len({x, y, z}) == 2:
                count += 3
            else:
                count += 6

print(count)


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
#coding: utf-8
K,S=map(int,input().split(" "))
answer=0
for X in range(K+1):
  for Y in range(K+1):
    print(X,Y)
    if S-(X+Y)<=K and S-(X+Y)>=0:
      answer+=1
print(answer)

#coding: utf-8
K,S=map(int,input().split(" "))
answer=0
for X in range(K+1):
  for Y in range(K+1):
    if S-(X+Y)<=K:
      answer+=1
print(answer)


#coding: utf-8
K,S=map(int,input().split(" "))
answer=0
for X in range(K+1):
  if S-X>2*K:
    continue
  for Y in range(K+1):
    if S-(X+Y)<=K and S-(X+Y)>=0:
      answer+=1
print(answer)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = map(int,input().split())

c = 0

if s == 3*k:
  c = 1
elif s >= 2*k:
  c = (5 - s % k) * 3
elif s >= k:
  pass
else:
  c = 3 * k
  
print(c)

k,s = map(int,input().split())

c = 0

for x in range(2,k+1):
  for y in range(2,k+1):
    for z in range(2,k+1):
      if x + y + z == s:
        c += 1
print(c)



k,s = map(int,input().split())

c = 0

if s == 3*k:
  c = 1
elif s >= 2*k:
  c = (5 - s % k) * 3
elif s >= k:
  c = pass
else:
  c = 3 * k
  
print(c)

k,s = map(int,input().split())

c = 0

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



Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z=s:
                count+=1
print(count)


#include <string>

#include <string.h>
#include <algorithm>

using namespace std;


int main(){
  int n;
  cin >> k >> s;
  count=0;
  for(int x=0; x<<k+1; x++){
    for(int y=0; y<<k+1; y++){
      for(int z=0; z<<k+1; z++){
        if(x+y+z==s){
          count++;
        }
      }  
    }
  }
  cout << count << endl;
  return 0;
}


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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = map(int, input().split())
count = 0

for i in range(k + 1):
    for j in range(k + 1)[i:]:
        for n in range(k + 1)[j:]:
            if i + j + n == s:
                count += 1

print(count)


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)


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = map(int, input().split())
x = range(k+1)
y = range(k+1)
cnt = 0
for i in x:
    for p in y:
        if (s-x+y) <= k:
            cnt += 1
print(cnt)

k, s = map(int, input().split())
x = range(k+1)
y = range(k+1)
z = range(k+1)
cnt = 0
for i in x:
    for p in y:
        if (s-(i+p)) in z:
            cnt += 1
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
ans = 0
k,s = map(int, input().split())
for x in range(k+1):
  for y in range(k+1):
    if s - (x+y) <= k:
      ans += 1
print(ans)

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


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K=int(input())
S=int(input())
cnt= 0

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

print(cnt)

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

for x in range(0,K+1):
    for y in range(0,K+1):
        for z in range(0,K+1):
            if((x + y + z )>S):
                break
                if ((x + y + z )== S):
                    cnt += 1

print(cnt)

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

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

print(cnt)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = map(int,input().split())
ans = 0

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

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)


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = list(map(int,input().split()))
ans = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z = s:
        ans += 1
print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = map(int,input().split())
count = 0
for i in range(k+1):
    for j in range(k+1):
        l = s-(i+j)
        print(i,j,l)
        if i+j+l == s and l >= 0 and l <= k and i <= k and j <= k:
            
            count += 1
print(count)

k,s = map(int,input().split())
count = 0
for i in range(k+1):
    for j in range(k+1):
        l = s-(i+j)
        if i+j+l == s and l >= 0 and l <= k and i <= k and j <= k:
            
            count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = map(int,input().split())
Xm = k
Ym = k
Zm = k
count = 0
for i in range(Xm+1):
  for j in range(Ym+1):
    for m in range(Zm+1):
      if i+j+m = s:
        count += 1
print(count)

k,s = map(int,input().split())
Xm = k
Ym = k
Zm = k 
count = 0
for i in range(Xm+1):
  for j in range(Ym+1):
    if s - (i+j) <= k:
        count += 1
print(count)

k,s = map(int,input().split())
x,y,z = k,k,k
cnt = 0
for i in range(k+1):
    for j in range(k+1):
        if 0<= s - (i+j) <= k:
            cnt +=1
print(cnt)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = map(int, input().split())
cnt = 0
for i in range(k):
  for j in range(k):
    if max(0, s-k) <= i+j <= s:
      cnt += 1
    elif i + j > s:
      break
print(cnt)

k, s = map(int, input().split())
cnt = 0
for i in range(k+1):
  for j in range(k+1):
    if max(0, s-k) <= i+j <= s:
      cnt += 1
    elif i + j > s:
      break
print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
    n,k = cin()
    ans = 0
    for i in range(n):
      for j in range(n):
        if k-i-j>=0 and k-i-j<=n:
          ans += 1
    print(ans)


if __name__ == '__main__':
    main()

from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
    n,k = cin()
    ans = 0
    for i in range(n+1):
      for j in range(n+1):
        if k-i-j>=0 and k-i-j<=(n):
          ans += 1
    print(ans)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())

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

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())
count = 0
for i in range(K):
    for j in range(i, K):
        for k in range(j, K):
            if i + j + k == S:
                count += 1
print(count)

K, S = map(int, input().split())
count = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            if i + j + k == S:
                count += 1
print(count)

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 and S - i - j <= K:
            count += 1
print(count)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())
ct = 0
for i in range(K+1):
    for j in range(K + 1):
        k = S - i - j
        if (S == (i + j + k)):
            ct += 1

print(ct)


K, S = map(int, input().split())
ct = 0
for i in range(K + 1):
    for j in range(K + 1):
        a = S - i - j
        if 0 <= a <= k:
            ct += 1

print(ct)


K, S = map(int, input().split())
ct = 0
for i in range(K + 1):
    for j in range(K + 1):
        a = S - i - j
        if 0 <= a <= K:
            ct += 1

print(ct)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s=map(int,input().split())
count=0
for x in range(k+1):
    for y in range(k+1):
        z=k-x-y
        if (x+y+z)==s:
             count+=1
print(count)

k,s=map(int, input().split())

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

k,s=map(int, input().split())
x+y+z=s
count=0
for x in range(k+1):
	for y in range(k+1):
    	for z in range(k+1):
        	if x+y+z=s:
            count+=1
print(count)

k,s=map(int, input().split())
x+y+z=s
count=0
for x in range(k+1):
	for y in range(k+1):
    	for z in range(z+1):
        	if x+y+z=s:
            count+=1
print(count)

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 (x+y+z)==s:
             count+=1
print(count)

k,s=map(int,input().split())
count=0
z=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if(0<=z)&(z<=k):
            count+=1
            
print(count)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())

li = []
for x in range(K+1):
    for y in range(K+1):
        if S-x-y >= 0 and S-x-y <= K:
            print([x, y, S-x-y])
            li.append([x, y, S-x-y])
print(len(li))

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
li = list(map(int,input().split()))
K, S = li[0], li[1]

count = 0

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

print(count)

li = list(map(int,input().split()))
K, S = li[0], li[1]

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())
X = []
Y = []
Z = []
count = 0

for i in range(0 ,K + 1):
	for j in range(0 ,K + 1):
		for k in range(0 ,K + 1):
			X.append(i)
			Y.append(i)
			Z.append(i)
			if S == X[i] + Y[j] + Z[k]:
				count += 1

print(str(count))

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

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

print(str(count))

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K,S=map(int,input().split())
ans=0
for i in range(K+1):
    for j in range(K+1):
        if (i+j)>S:
            break
        if (S-K)<=(i+j):
            break
        ans+=1

print(ans)

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:
            if z<=K:
                ans+=1

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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)
            print(z)
            
            if 0 <= z and z <= ks[0]:
                count += 1
                
        
            targetY +=1
        
    targetX +=1
        
 
print(count)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

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

k, s = list(map(int, input().split()))

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

print(ans)


# coding: utf-8
 
k, s = list(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)

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K,S = list(map(int,input().split()))

counter = 0

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

print(counter)

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

counter = 0

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

print(counter)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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 <= k and z<=k:
            ans += 1 
print(ans)

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)

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 and z<=k:
            ans += 1 
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = map(int,input().split())

count=0

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


k, s = map(int,input().split())

count=0

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


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):

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:
            cnt+=1
print(cnt)



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 and S-i-j<=K:
            cnt+=1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
jmax=min(s-i+1,k+1)
for i in range(imax):
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
for i in range(imax):
	jmax=min(s-i+1,k+1)
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k = int(input())
s = int(input())

ans = 0

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

print(ans
    
	

k, s = map(int, input().split(" "))

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

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
import math
N = int(input())
P = list(tuple(map(int, input().split())) for _ in range(N))

M = 0
for i in range(N):
    for j in range(1,N):

        M = max(M, math.sqrt((P[i][0]-P[j][0]) ** 2 + (P[i][1]-P[j][1]) ** 2))

print("{:.6f}".format(M))

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

cnt = 0

if S <= 0:
  cnt += 1
else:

  if K >= S:
      cnt+=3

  def cnt2(k, s):
      if 2 * k >= s:
          if s - 1 <= k:
              return s-1
          else:
              return k-(s-k)+1
      else:
          return 0

  cnt+=3*cnt2(K, S)

  for x in range(1, K+1):
      if S-x <=0:
          break
      cnt += cnt2(K, S-x)

print(cnt)

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = map(int, input().split())
print([x+y+z for x in range(k) for y in range(k) for z in range(k)].count(s))
          

n, s = map(int, input().split())
cnt=0
for i in range(n+1):
  for j in range(n+1):
    S = s-i-j
    if S<=n:
      cnt+=1
print(cnt)

k,s = map(int, input().split())
print([x+y+z for x in range(k) for y in range(k) for z in range(k)].count(s))

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)


n, s = map(int, input().split())
cnt=0
for i in range(n+1):
  for j in range(n+1):
    S = s-i-j
    if S<=n and S>=0:
      cnt+=1
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = map(int, input().split())
count = 0
for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if 0 <= s - (i + j) <= k:
                count += 1
print(count)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = map(int,input().split())
ans  = 0
for i in range(k):
  for j in range(k):
    z = s-i-j
    if z >= 0 and z <= k:
      ans += 1
print(ans)

k,s = map(int,input().split())
ans  = 0
for i in range(k):
  for j in range(k):
    z = s-i-k
    if z >= 0 and z <= k:
      ans += 1
print(ans)

k,s = map(int,input().split())
ans  = 0
for i in range(0,k+1):
  for j in range(0,k+1):
    z = s-i-j
    if z >= 0 and z <= k:
      ans += 1
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s=map(int,input().split())
cnt=0
print(k,s)
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)

k,s=map(int,input().split())
cnt=0
for i in range(k):
  for j in range(k):
    for l in range(k):
      if i+j+l=s:
        cnt+=1
print(cnt)

k,s=map(int,input().split())
cnt=0
#print(k,s)
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)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k, s = map(int, input().split(' '))
cnt_pattern = 0
for a in range(k+1):
  if a > s:
    continue
    for b in range(k+1):
      if a + b > s:
        break
        for c in range(k+1):
          if s == a + b + c:
            cnt_pattern += 1
            if s < a + b + c:
              break
print(cnt_pattern)

k, s = map(int, input().split(' '))
cnt_pattern = 0
for a in range(k+1):
  if a > s:
    break
    for b in range(k+1):
      if a + b > s:
        break
        for c in range(k+1):
          if s == a + b + c:
            cnt_pattern += 1
            if s < a + b + c:
              break
print(cnt_pattern)

k, s = map(int, input().split(' '))
cnt_pattern = 0
for a in range(k + 1):
  for b in range(k + 1):
    if 0 <= s - a - b <= k:
      cnt_pattern += 1
print(cnt_pattern)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

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


def main():
    k, s = map(int, input().split())
    answer = solve(k, s)
    return answer


def solve(k, s):
    count = 0
    for i in range(k + 1):
        v = 0
        v += i
        if v == s:
            count += 1
            continue
        for j in range(k + 1):
            v += j
            if v == s:
                count += 1
                continue
            for k in range(k + 1):
                v += k
                if v == s:
                    count += 1
                    continue
    return count

print(main())

# -*- coding: utf-8 -*-


def main():
    k, s = map(int, input().split())
    answer = solve(k, s)
    return answer


def solve(k, s):
    count = 0
    for i in range(k + 1):
        for j in range(k + 1):
            z = s - i - j
            if 0 <= z and z <= k:
                count += 1
    return count

print(main())


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())
count = 0

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


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

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

print(count)


K, S = 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 <= K:
            count += 1
print(count)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = map(int,input().split())
ans = 0
for i in range(k+1):
    for j in range(k+1):
        if (s-(i+j)) <= k:
            ans += 1
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s=map(int,input().split())

count=0

for i in range(k+1):
    for j in range(k+1):
        z=s-(i+j)
        
        if nums.count(z):
            count+=1
print(count)


k,s=map(int,input().split())

nums=[]

for i in  range(k+1):
    nums.append(i)

x=y=nums

count=0

for i in x:
    for j in y:
        z=s-(i+j)

    if nums.count(z):
        count+=1
print(count)


k,s=map(int,input().split())

count=0

for i in range(k+1):
    for j in range(k+1):
        z=s-(i+j)

    if 0<=z<=k:
        count+=1

print(count)


k,s=map(int,input().split())

nums=[]

for i in  range(k+1):
    nums.append(i)

x=y=z=nums

count=0

for i in x:
    for j in y:
        a=s-(i+j)

    if z.count(a)==1:
        count+=1
print(count)


k,s=map(int,input().split())

nums=[]

for i in  range(k+1):
    nums.append(i)

x=y=z=nums

count=0

for i in x:
    for j in y:
        x=s-(i+j)

    if z.count(x)==1:
        count+=1
print(count)


k,s=map(int,input().split())

nums=[]

for i in  range(k+1):
    nums.append(i)

x=y=nums

count=0

for i in x:
    for j in y:
        z=s-(i+j)

    if 0<=z<=k:
        count+=1

print(count)


k,s=map(int,input().split())

cnt=0

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

print(cnt)


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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)

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

print(ans)

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)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int, input().split())

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

#                     if x+y+z==S:
#                         count += 1
print(count)

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

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

#                     if x+y+z==S:
#                         count += 1
print(count)

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

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

#                     if x+y+z==S:
#                         count += 1
print(count)

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

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

#                     if x+y+z==S:
#                         count += 1
print(count)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
import itertools

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

#if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
#    exit()

ans = [[x,y,z] for x in range(2, K+1) for y in range(2, K+1) for z in range(2, K+1) if (x+y+z)==S]
print(len(ans))


import itertools

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

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

ans = [[x,y,z] for x in range(2, K+1) for y in range(2, K+1) for z in range(2, K+1) if (x+y+z)==S]
print(len(ans))


import itertools

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

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

ans = [[x,y] for x in range(2, K+1) for y in range(2, K+1) if (0<=(S-X-Y)) and ((S-X-Y)<=K)]
print(len(ans))


import itertools

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

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

ans = [[X,Y] for X in range(2, K+1) for Y in range(2, K+1) if (0<=(S-X-Y)) and ((S-X-Y)<=K)]
print(len(ans))


import itertools

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

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

count = 0
for X in range(0, K + 1):
    for Y in range(0, K + 1):
        if 0 <= (S - X - Y) and (S - X - Y) <= K:
            count += 1

print(count)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K, S = map(int(), input().split())

s = 0
for X in range(K+1):
	for Y in range(K+1):
		Z = S - (X+Y)
		if 0 <= Z and Z <= K:
			s += 1
print(s)


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

s = 0
for X in range(K+1):
	for Y in range(K+1):
		Z = S - (X+Y)
		if 0 <= Z and Z <= K:
			s += 1
print(s)


Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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:
      #print(i, j, (S - (i + j)))
      count += 1
print(count)

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:
      #print(i, j, (S - (i + j)))
      count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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:
            ans += 1

print(ans)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
import sys
input = sys.stdin.readline

#+++++
		
def main():
	k, s = map(int, input().split())
	c=0
	for x in range(k+1):
		for y in range(k+1):
			c+=1 if s-(x+y) <= k else 0
	
	print(c)
	
	
#+++++

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		
	ret = main()
	if ret is not None:
		print(ret)

import sys
input = sys.stdin.readline

#+++++
		
def main():
	k, s = map(int, input().split())
	c=0
	for x in range(k+1):
		for y in range(k+1):
			ccc=s-(x+y)
			c+=1 if ccc <= k and 0<= ccc else 0
	
	print(c)
	
	
#+++++

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		
	ret = main()
	if ret is not None:
		print(ret)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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(i,j,s-i-j)
print(cnt)         

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)      

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K,S=map(int,input().split())
cnt=0
K+=1
for i in range(K):
  for j in range(K):
    k=S-(i+j)
    if (S>=0) and (S<=K)
      cnt+=1
print(cnt)


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)

Verdicts: Runtime Error

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K,S = map(int,(input().split()))

res = [(x,y,z) for x in range(K+1)
for y in range(K+1)
for z in range(K+1)
if x+y+z==S]

print(res)
print(len(res))

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

res = [(x) for x in range(K+1)
for y in range(K+1)
if x+y <= S and x+y >= S-K]

print(len(res))

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
k,s = list(map(int,input().split()))
ans = 0
for i in range(k):
  for j in range(k):
    if 0 <= s-i-j <= k
      ans += 1
print(ans)

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


k,s = list(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)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
K,S = map(int,input().split(" "))
         
s = 0
         
for x in range(K+1):
  for y in range(min(K+1,S-x+1)):
    if 0<=S-x - y <= K:
      s+=1
      break               
print(s)

K,S = map(int,input().split(" "))
             
s = 0
             
for x in range(K+1):
  for y in range(min(K+1,S-x+1)):
    if 0<=S-x - y <= K:
      s+=1
                     
print(s)

Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
n,m=map(int,input().split())
count=0
for i in range(n+1):
  for j in range(n+1):
    if m-j-i>0:
      count+=1
print(count)

n,m=map(int,input().split())
count=0
for i in range(n+1):
  for j in range(n+1):
    if m-j-i>=0 and m-j-i<=n:
      count+=1
print(count)


Verdicts: Wrong Answer

Accepted
Problem: You are given two integers K and S.   Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.   How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted