ZhenlongDai/ACPR huggingface dataset:
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
x = (N*(N+1)/2)
print(x)

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
N = int(input())
print(round(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())



print((1 + N)/2*N)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


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



print(int((1 + N)/2*N))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
print((1+num)*num/2)

Failing test case input:
-647

Expected output:
208981


Actual output:
208981.0


Fixed submission (verdict: Accepted):
num = int(input())
print((1+num)*num

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print((1+n)*n/2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
n=int(input())
print(int((1+n)*n/2))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=input()
n=int(n)
print(n*(1+n)/2)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
n=input()
n=int(n)
print(n*(1+n)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input('子供は何人？'))

a=N*(N+1)/2

print(a)

Failing test case input:
-299

Expected output:
44551


Actual output:
子供は何人？44551.0


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

a=int(N*(N+1)/2)

print(a)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
number = int(input("人数を入力＞"))
print(int(1/2*number*(number+1)))

Failing test case input:
-249

Expected output:
30876


Actual output:
人数を入力＞30876


Fixed submission (verdict: Accepted):
number = int(input())

print(int((number + 1)*number/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
s=a*(a+1)/2
print(s)

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
a=int(input())
s=a*(a+1)/2
print(int(s))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(((n+1)*n)/2)


Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
n=int(input())
print(int((n+1)*n/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print((N+1)*N/2)

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
n=int(input())
print(n*(n+1)
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*(n+1)/2)

Failing test case input:
-647

Expected output:
208981


Actual output:
208981.0


Fixed submission (verdict: Accepted):
n=int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
     
print(N*(N+1)/2)
     


Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
n=int(input())
     
sum=n*(n+1)/2
     
print(int(sum))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
 
print(n*(n-1)/2)

Failing test case input:
-792

Expected output:
313236


Actual output:
314028.0


Fixed submission (verdict: Accepted):
n = int(input())
 
print(int(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*(n+1)/2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
n=int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
print( num * (num+1) / 2 )

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
num = int(input())
print(int( num * (num+1) / 2 ))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n = ni()
print((n*(n+1))/2)


Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n = ni()
print(int((n*(n+1))/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print((N * (N + 1)) / 2)

Failing test case input:
-647

Expected output:
208981


Actual output:
208981.0


Fixed submission (verdict: Accepted):
N = int(input())
print((N * (N + 1))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(((n)*(n+1))/2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
n = int(input())
print(((n)*(n+1))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*(n+1)/2)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
n=int(input())
print(n*(n+1)
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input());print(n*-~n/2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
n=int(input());print(n*-~n

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())

print(a*(a+1)/2)

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
a=int(input())

print(int(a*(a+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N*(N+1)/2)

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
N = int(input())
print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
print(N*(N+1))

Failing test case input:
-249

Expected output:
30876


Actual output:
61752


Fixed submission (verdict: Accepted):
N=int(input())
print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n * (n + 1) / 2)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n * (n + 1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    n = int(input())
    print((n * (n + 1)) / 2)
if __name__ == '__main__':
    main()

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    print(int((n * (n + 1)) / 2))
if __name__ == '__main__':
    main()

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = 3

camdy_for_pair =  (1 + N)
num_of_pairs, amari = divmod((N),2)

if amari == 0:
    nesseary_candy = num_of_pairs * camdy_for_pair
else :
    nesseary_candy = num_of_pairs * camdy_for_pair + num_of_pairs + 1
    
print(nesseary_candy)

Failing test case input:
-254

Expected output:
32131


Actual output:
6


Fixed submission (verdict: Accepted):
N = int(input())
camdy_for_pair =  (1 + N)
num_of_pairs, amari = divmod((N),2)

if amari == 0:
    nesseary_candy = num_of_pairs * camdy_for_pair
else :
    nesseary_candy = num_of_pairs * camdy_for_pair + num_of_pairs + 1
    
print(nesseary_candy)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*(n+1)/2)


Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
n=int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = 1/2*N*(N+1)
print(a)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
N = int(input())
a = 1/2*N*(N+1)
print(int(a))
Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


N = int(input()) 

candy = N * (N + 1) / 2

print(candy)


Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):


N = int(input()) 

candy = int(N * (N + 1) / 2)

print(candy)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

print(N * (N+1)/2)

Failing test case input:
-647

Expected output:
208981


Actual output:
208981.0


Fixed submission (verdict: Accepted):
N = int(input())
 
print(int(N * (N+1)/2))

Problem: p04029
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
subin = int(input())
print(((1+subin) * subin) / 2)


Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
subin = int(input())
res = int((1+subin) * subin / 2)
print(res)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print((n*(n+1))/2)

Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print("{}".format(n*(n+1)/2))

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
n = int(input())
print("{}".format(int(n*(n+1)/2)))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
print(N*N+1/2)

Failing test case input:
-845

Expected output:
356590


Actual output:
714025.5


Fixed submission (verdict: Accepted):
N=int(input())
print(int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*(n+1)%2)

Failing test case input:
-845

Expected output:
356590


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())





a = N+1
b = N

print( a * b / 2 )


Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


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





a = N+1
b = N

print(int( a * b * 0.5 ))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(int(n*n+1/2))

Failing test case input:
-164

Expected output:
13366


Actual output:
26896


Fixed submission (verdict: Accepted):
n=int(input())
print(int((n**2+n)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())

print(0.5*N*(N+1))

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


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

print(int(0.5*N*(N+1)))
Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
print(n*(n+1)/2)


Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
n=int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N*(N+1)/2)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
N =int(input())
print(int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print((n+1)*n/2)


Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
n = int(input())
print(int((n+1)*n/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

m=n-(n-1)
print((n/2)*(n+m))

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
n=int(input())

m=n-(n-1)
print(int((n/2)*(n+m)))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = N*N/2+N/2
print(S)

Failing test case input:
-845

Expected output:
356590


Actual output:
356590.0


Fixed submission (verdict: Accepted):
N = int(input())
S = int(N*N/2+N/2)
print(S)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

ans = N*(N+1)/2
print(ans)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
N = int(input())
 
ans = int(N*(N+1)/2)
print(ans)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=n*(n+1)/2
print(a)

Failing test case input:
-647

Expected output:
208981


Actual output:
208981.0


Fixed submission (verdict: Accepted):
n=int(input())
a=int(n*(n+1)/2)
print(a)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
print(0.5*a*(a+1))

Failing test case input:
-845

Expected output:
356590


Actual output:
356590.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

print(int((n+1)/2))

Failing test case input:
-845

Expected output:
356590


Actual output:
-422


Fixed submission (verdict: Accepted):
n = int(input())

print(int((n+1) * n/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
y = (x + 1)*x/2
print(y)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
x = int(input())
y = (x + 1)*x
print(int(y/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def total(n):
  return 1/2 * n * (n + 1)

n = int(input())
print(total(n))

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
def total(n):
  return int(1/2 * n * (n + 1))
 
n = int(input())
print(total(n))
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
N = n*(n+1)/2
print(N)

Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
n = int(input())
N = int(n*(n+1)/2)
print(N)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print(N*(N+1)/2)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
N=int(input())
print(int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
print((N*(N+1))/2)

Failing test case input:
-845

Expected output:
356590


Actual output:
356590.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int((N*(N+1))/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N*(N+1)/2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
N = int(input())
print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
b = a * (a + 1 ) /2
print(b)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
a = int(input())
b = a * (a + 1) / 2
print(int(b))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
candy = N * (N+1) / 2
print(candy)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
N = int(input())
candy = N * (N + 1) / 2
print(int(candy))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N*(N+1)/2)


Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
N = int(input())
print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(int(n*(n-1)/2))

Failing test case input:
-299

Expected output:
44551


Actual output:
44850


Fixed submission (verdict: Accepted):
n = int(input())
print(int(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
ans = num * (num+1) / 2
print(ans)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
num = int(input())
ans = int(num * (num + 1) / 2)
print(ans)
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print((1 + n) * n /2 )

Failing test case input:
-845

Expected output:
356590


Actual output:
356590.0


Fixed submission (verdict: Accepted):
n = int(input())
print(int((1 + n) * n /2 ))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

print((N ** 2 + N) / 2)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


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

print((N ** 2 + N)

Problem: p04029
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
print(N * (1 + N) / 2)

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int(N * (1 + N) / 2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
print (N*(N+1)/2)

Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int((N*(N+1))/2))

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


N = int(input())
print(N * (N + 1) / 2)


Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):


N = int(input())
print(N * (N + 1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
print((x/2)*(x+1))

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
n=int(input())
print(int (n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
print(N*(1+N)%2)

Failing test case input:
-647

Expected output:
208981


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
print(N*(1+N)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print( N*(N+1)/2)

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
N = int(input())
print( int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
i = int(input())
print(i*(i + 1) /2)

Failing test case input:
-647

Expected output:
208981


Actual output:
208981.0


Fixed submission (verdict: Accepted):
i = int(input())
print(int(i*(i + 1) /2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n-1)/2)

Failing test case input:
-465

Expected output:
107880


Actual output:
108345.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

print(n*(n+1)/2)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
n = int(input())
 
print(int(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

candy=N*(1+N)/2
print(candy)

Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
N = int(input())
 
candy=(1+N)*N/2
print(int(candy))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print((1+n)/2*n)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
n=int(input())
print(int((1+n)/2*n))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
print(N*(N+1)/2)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
N=int(input())
print(int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
print((1+a)*a/2)

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
a=int(input())
print(int((1+a)*a/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
sum = (num + 1) * num / 2
print(sum)

Failing test case input:
-647

Expected output:
208981


Actual output:
208981.0


Fixed submission (verdict: Accepted):
num = int(input())
sum = (num + 1) * num / 2
print(int(sum))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
n = int(input())
print(int(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

print(n * (n +1) / 2)


Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
n = int(input())

print(int((n * (n + 1)) / 2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
print((x*(x+1))/2)

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
x = int(input())
print(int(x*(x+1)/2))

Problem: p04029
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
x = int(input())

print((x+1)*x/2)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
x = int(input())
 
print(int((x+1)*x/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N*(N+1)/2)

Failing test case input:
-299

Expected output:
44551


Actual output:
44551.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int(N*(N+1)/2))
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ans =N*(N+1)/2

print(ans)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


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

ans =int(N*(N+1)/2)

print(ans)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N * (N+1) / 2)


Failing test case input:
-845

Expected output:
356590


Actual output:
356590.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int(N * (N+1) / 2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print(N*(N+1)/2)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
N = int(input())
print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
print((a+1)*a/2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
a=int(input())
print(int((a+1)*a/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print((n+1)*n/2)

Failing test case input:
-198

Expected output:
19503


Actual output:
19503.0


Fixed submission (verdict: Accepted):
n=int(input())
print(int((n+1)*n/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
ans = N*(N-1)/2
print(int(ans))

Failing test case input:
-299

Expected output:
44551


Actual output:
44850


Fixed submission (verdict: Accepted):
N = int(input())
ans = N*(N+1)/2
print(int(ans))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
s=N*(N+1)/2
print(s)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
N=int(input())
s=N*(N+1)/2
print(int(s))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-845

Expected output:
356590


Actual output:
356590.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
n = int(input())
print(int(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())

sum=n*(n+1)/2

print(sum)

Failing test case input:
-845

Expected output:
356590


Actual output:
356590.0


Fixed submission (verdict: Accepted):
n=int(input())
     
sum=n*(n+1)/2
     
print(int(sum))
Problem: p04029
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())

A = (N*(N+1))/2
print(A)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


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

print(int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
print(n*(n+1)/2)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
n=int(input())
print(int(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print(N*(N-1)/2)

Failing test case input:
-465

Expected output:
107880


Actual output:
108345.0


Fixed submission (verdict: Accepted):
N=int(input())
print(int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

print(n*(n+1)/2)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
n = int(input())

print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
subin = int(input())
res = (1+subin) * subin / 2
print(res)

Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
subin = int(input())
res = int((1+subin) * subin / 2)
print(res)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
 
candy=(1+N)*N/2
print(candy)

Failing test case input:
-164

Expected output:
13366


Actual output:
13366.0


Fixed submission (verdict: Accepted):
N = int(input())
 
candy=(1+N)*N/2
print(int(candy))

Problem: p04029
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    import sys
    
    n = int(sys.stdin.readline())
    
    print(n*(n+1)/2)
    
if __name__ == "__main__":
    main()

Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
def main():
    import sys
    
    n = int(sys.stdin.readline())
    
    print(int(n*(n+1)/2))
    
if __name__ == "__main__":
    main()

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print(N*(N+1)/2)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
N=int(input())
print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.8.2), verdict: Wrong Answer):




N = int(input())

print(N/2*(N+1))

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):



N = int(input())

print(N * (N+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print((1+N) * N/2)


Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int((1+N) * N/2))
Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
print(num * (num + 1)/2)

Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int(N * (N + 1) / 2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N * (N + 1) / 2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
N = int(input())
print(N * (N + 1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print(N*(N+1)/2)

Failing test case input:
-937

Expected output:
438516


Actual output:
438516.0


Fixed submission (verdict: Accepted):
N=int(input())
print(int(N*(N+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
print(N*(N+1)/2)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
N = int(input())
print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input());print(N*(N+1/2))

Failing test case input:
-845

Expected output:
356590


Actual output:
713602.5


Fixed submission (verdict: Accepted):
N=int(input());print(N*(N+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

print(n*(n+1)/2)


Failing test case input:
-465

Expected output:
107880


Actual output:
107880.0


Fixed submission (verdict: Accepted):
n = int(input())

print(round(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
print(num * (num+1) / 2)

Failing test case input:
-792

Expected output:
313236


Actual output:
313236.0


Fixed submission (verdict: Accepted):
N = int(input())
print(int(N * (N + 1) / 2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
print(n*(n+1)/2)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
n = int(input())
print(int(n*(n+1)/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
c = n*(n+1)/2
print(c)


Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
n = int(input())
print(n*(n+1)

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
print((N+1)*N/2)

Failing test case input:
-249

Expected output:
30876


Actual output:
30876.0


Fixed submission (verdict: Accepted):
N=int(input())
print(round((N+1)*N/2))

Problem: p04029
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
ans = (N * (N + 1) / 2)
print(ans)

Failing test case input:
-254

Expected output:
32131


Actual output:
32131.0


Fixed submission (verdict: Accepted):
N = int(input())
ans = int(N * (N + 1) / 2)
print(ans)
Problem: p02247
Buggy submission (Python3, verdict: Wrong Answer):
T = input()
P = input()
idx = 0
ans = 1000
while (ans != -1):
    ans = T.find(P, idx)
    if (ans == -1):
        break
    else:
        print(ans)
        idx += len(P)

Failing test case input:
aaab`a
ab

Expected output:
2


Actual output:
2
2


Fixed submission (verdict: Accepted):
T = input()
P = input()
idx = 0
ans = 1000
while (ans != -1):
    ans = T.find(P, idx)
    if (ans == -1):
        break
    else:
        print(ans)
        if (ans==0):
            idx+=1
        else:
            idx=ans+1

Problem: p02247
Buggy submission (Python3, verdict: Wrong Answer):
T = input()
P = input()
idx = 0
while (1):
    ans = T.find(P, idx)
    if (ans != -1):
        print(ans)
        T=T.replace(T[ans],"?",1)
        print(T)
        idx += len(P)
    else:
        break

Failing test case input:
ababab
ab

Expected output:
0
2
4


Actual output:
0
?babab
2
?b?bab
4
?b?b?b


Fixed submission (verdict: Accepted):
T = input()
P = input()
idx = 0
ans = 1000
while (ans != -1):
    ans = T.find(P, idx)
    if (ans == -1):
        break
    else:
        print(ans)
        if (ans==0):
            idx+=1
        else:
            idx=ans+1

Problem: p02247
Buggy submission (Python3, verdict: Wrong Answer):
text=input()
string=input()






len_string=len(string)
common_length=[0]*len_string
tmp=0
for i in range(1,len_string):
    if(string[i]==string[tmp]):
        if(string[i-1]==string[tmp-1]):
            common_length[i-1]=1
        else:
            common_length[i-1]=0
        tmp+=1
    else:
        common_length[i-1]=tmp
        if(string[i]==string[0]):
            tmp=1
        else:
            tmp=0

if(string[-1]==string[tmp-1]):
    common_length[-1]=tmp



tmp=0

for i in range(len(text)):
    if(text[i]!=string[tmp]):
        while(text[i]!=string[tmp] and tmp>1):
            tmp=common_length[max([tmp-1,0])]
        if(text[i]==string[tmp]):
            tmp+=1
    else:
        tmp+=1
        if(tmp==len_string):
            print(i-tmp+1)
            tmp=common_length[-1]


Failing test case input:
aaacaa
aa

Expected output:
0
1
4


Actual output:
0
1
3
4


Fixed submission (verdict: Accepted):
text=input()
string=input()






len_string=len(string)
common_length=[0]*len_string
tmp=0
for i in range(1,len_string):
    if(string[i]==string[tmp]):
        if(string[i-1]==string[tmp-1]):
            common_length[i-1]=1
        else:
            common_length[i-1]=0
        tmp+=1
    else:
        common_length[i-1]=tmp
        if(string[i]==string[0]):
            tmp=1
        else:
            tmp=0

if(string[-1]==string[tmp-1]):
    common_length[-1]=tmp
common_length[0]=0



tmp=0

for i in range(len(text)):
    if(text[i]!=string[tmp]):
        while(text[i]!=string[tmp] and tmp>0):
            tmp=common_length[max([tmp-1,0])]
        if(text[i]==string[tmp]):
            tmp+=1
    else:
        tmp+=1
        if(tmp==len_string):
            print(i-tmp+1)
            tmp=common_length[-1]
Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while True :
    n, x = map(int, input().split())
    if (n == x == 0) :
        break

    count = 0
    for a in range(1, n, 1) :
        for b in range((a+1), n, 1) :
            for c in range((b+1), n, 1) :
                Sum = a + b + c
                if (Sum == x) :
                    count += 1
    print(count)

Failing test case input:
17 25
0 0

Expected output:
31


Actual output:
28


Fixed submission (verdict: Accepted):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

    count = 0
    for a in range(1, x 
        for b in range(a + 1, x 
            for c in range(b + 1, n + 1):
                Sum = a + b + c
                if (Sum == x):
                    count += 1 
    print(count)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    n, x = map(int, input().split())
    if n == 0 and x == 0:
        break

    c = 0
    for i in range(1, int(x/3)+2):
        for j in range(i+1, int(x/2)+2):
            k = x - i - j
            print('',i,j,k)
            if k <= j:
                break
            elif k <= n:
                c += 1
    print(c)

Failing test case input:
5 10
0 0

Expected output:
2


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


Fixed submission (verdict: Accepted):
while True:
    n, x = map(int, input().split())
    if n == 0 and x == 0:
        break

    c = 0
    for i in range(1, int(x/3)+2):
        for j in range(i+1, int(x/2)+2):
            k = x - i - j
            if k <= j:
                break
            elif k <= n:
                c += 1
    print(c)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    n, x = list(map(int, input().split(" ")))
    if (n == 0) and (x == 0):
        break
    ans = 0
    for i in range(1, n-1):
        for j in range(i, n):
            for k in range(j, n+1):
                if n == i+j+k:
                    ans += 1
                    break
    print (ans)

Failing test case input:
3 7
0 0

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
while True:
    n, x = list(map(int, input().split(" ")))
    if (n == 0) and (x == 0):
        break
    ans = 0
    for i in range(1, n-1):
        for j in range(i+1, n):
            for k in range(j+1, n+1):
                if x == i+j+k:

                    ans += 1
                    break
    print (ans)
Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while(1):
    n, x = map(int, input().split())

    if n == 0 and x == 0:
        break

    count = 0
    for i in range(1, n-1):
        if i*3 > x:
            break
        for j in range(i, n):
            if i+2*j < x:
                break
            if x-i-j <= n:
                count += 1

    print(count)

Failing test case input:
8 20
0 0

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
while(1):
    n, x = map(int, input().split())

    if n == 0 and x == 0:
        break

    count = 0
    for i in range(1, n-1):
        if i*3 >= x:
            break
        for j in range(i+1, n):
            if i+2*j >= x:
                break
            if x-i-j <= n:
                count += 1

    print(count)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    n, x = map(int, input().split())
    if n == x == 0:
        break
    count = 0
    for i in range(1,n):
        for j in range(1,n):
            for k in range(1,n):
                if i+j+k ==x:
                    count += 1
    print(count)

Failing test case input:
7 9
0 0

Expected output:
3


Actual output:
25


Fixed submission (verdict: Accepted):
while True:
    n, x = map(int, input().split())
    if n == x == 0:
        break
    count = 0
    for i in range(1,n+1):
        for j in range(1,n+1):
            for k in range(1,n+1):
                if (i < j < k):
                    if i+j+k == x:
                        count += 1
    print(count)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):





while True:
	N, x = map(int,input().split())
	if N == 0 and x == 0:
		break
	
	n = x 
	ctr = 0
	
	for i in range(1, n):
		for j in range(i+1, n+1):
			k = x - i -j
			if k <= N and i != k and j != k:
				ctr += 1
				
	
	print(ctr)

Failing test case input:
3 3
0 0

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):




while True:
	N, x = map(int,input().split())
	if N == 0 and x == 0:
		break
	
	ctr = 0
	
	for i in range(1, N+1):
		for j in range(i+1, N+1):
			k = x - i -j
			if k <= j:
				break
			elif k <= N and j < k:
				ctr += 1
				
			
	print(ctr)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
N,M = map(int, input().split())
ans = 0
while not (N == 0 and M == 0):
 for i in range(1, N+1):
  for j in range(1, N+1):
   k = M - i - j
   if ( i==j or i==k or j==k or k > N-3): pass
   elif (i + j + k == M): ans += 1
 N,M = map(int, input().split())
print(ans)

Failing test case input:
20 32
0 0

Expected output:
45


Actual output:
276


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())
ans = 0
while not (N == 0 and M == 0):
 for i in range(1, N+1):
  for j in range(i+1, N+1):
   k = M - i - j
   if ( k > N): pass
   elif  k <= j : break
   else: ans += 1
 print(ans)
 ans = 0
 N,M = map(int, input().split())
Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while 1:
    n, x = map(int,input().split())
    if n ==0 and x ==0:
        break
    ans  = 0
    for i in range(n-1):
        for j in range(i,n):
           for k in range(j,n):
               if i + j +k ==x:
                   ans += 1
    print(ans)



Failing test case input:
17 25
0 0

Expected output:
31


Actual output:
40


Fixed submission (verdict: Accepted):
while 1:
    n, x = map(int,input().split())
    if n == x ==0:
        break
    ans  = 0
    for i in range(1, n+1):
        for j in range(i+1,n+1):
           for k in range(j+1,n+1):
               if i + j +k ==x:
                   ans += 1
    print(ans)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):



























result = []
n=[]
x=[]

while 1:
	temp = input().split() 
	if temp[0]=="0" and temp[1]=="0":
		break;
	else:
		n.append( int( temp[0] ))
		x.append( int( temp[1] ))

for i in range( len(n) ):
	count =0
	for n1 in range(1,n[i]+1-2):
		for n2 in range(n1+1, n[i]+1-1):
			for n3 in range(n2+1, n[i]+1):
				sum = n1+n2+n3
				if sum == x[i]:
					count+=1
	result.append(count)

print( len(result) ) 
for i in range( len(result) ):
	if i == len(result)-1:
		print(result[i])
	else:
		print("{0} ".format(result[i]), end="")

Failing test case input:
12 13
0 0

Expected output:
8


Actual output:
1
8


Fixed submission (verdict: Accepted):



























result = []
n=[]
x=[]

while 1:
	temp = input().split() 
	if temp[0]=="0" and temp[1]=="0":
		break;
	else:
		n.append( int( temp[0] ))
		x.append( int( temp[1] ))

for i in range( len(n) ):
	count =0
	for n1 in range(1,n[i]+1-2):
		for n2 in range(n1+1, n[i]+1-1):
			for n3 in range(n2+1, n[i]+1):
				sum = n1+n2+n3
				if sum == x[i]:
					count+=1
	result.append(count)

for i in range( len(result) ):
	print(result[i])

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
import math
while True:
    n,x = map(int,input().split())
    if n == x == 0:
        break

    c = 0
    for i in range(math.ceil(x/3), x-3):
        for j in range(math.ceil(i/2), i):
            k = i - j
            if x == i + j + k:
                
                c += 1
    print(c)


Failing test case input:
16 12
0 0

Expected output:
7


Actual output:
3


Fixed submission (verdict: Accepted):
while True:
    n,x = map(int,input().split())
    if n == x == 0:
        break

    n = n + 1
    c = 0
    for i in range(1,n):
        for j in range(i+1,n):
            for k in range(j+1,n):
                if x == i + j + k:
                    c += 1
    print(c)
Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
N,M = map(int, input().split())
ans = 0
while not (N == 0 and M == 0):
 for i in range(1, N+1):
  for j in range(i, N+1):
   k = M - i - j
   if ( i==j or i==k or j==k): pass
   elif (i + j + k == M): ans += 1
 N,M = map(int, input().split())
print(ans)

Failing test case input:
12 22
0 0

Expected output:
14


Actual output:
60


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())
ans = 0
while not (N == 0 and M == 0):
 for i in range(1, N+1):
  for j in range(i+1, N+1):
   k = M - i - j
   if ( k > N): pass
   elif  k <= j : break
   else: ans += 1
 print(ans)
 ans = 0
 N,M = map(int, input().split())

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while True:
 n,x=map(int,input().split())
 if n==x==0: break
 
 count=0

 for i in range(n-1):
  for k in range(i+1,n):
   for j in range(k+1,n+1):
     if i+k+j==x :
       count = count +1


 print('count')
       

Failing test case input:
5 6
0 0

Expected output:
1


Actual output:
count


Fixed submission (verdict: Accepted):
while True:
  n,x=map(int,input().split())
  
  if n==x==0 : break
  
  count = 0 
  for i in range(1,n-1) :
    for j in range(i+1,n):
      for k in range(j+1,n+1):
        if i+j+k==x :
          count = count +1

  print(count)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while True:
    cou = 0
    n,x = map(int,input().split())
    if n==0 and x==0:
        break
    for i in range(1,x):
        for j in range(i,x):
            k = x - i - j
            if i<=n and j<=n and k<=n:
                cou += 1
    print(cou)
                


Failing test case input:
3 6
0 0

Expected output:
1


Actual output:
5


Fixed submission (verdict: Accepted):
while True:
    cou = 0
    n,x = map(int,input().split())
    if n==0 and x==0:
        break
    for i in range(1,x
        for j in range(i+1,x
            k = x - i - j
            if i<=n and j<=n and k<=n and k>j:
                cou += 1
    print(cou)

Problem: p02412
Buggy submission (Python3, verdict: Wrong Answer):
while True :
    n, x = map(int, input().split())
    if (n == x == 0) :
        break

    count = 0
    for a in range(1, n) :
        for b in range(a + 1, n) :
            for c in range(b + 1, n) :
                Sum = a + b + c
                if (Sum == x) :
                    count += 1
    print(count)

Failing test case input:
16 25
0 0

Expected output:
28


Actual output:
24


Fixed submission (verdict: Accepted):
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

    count = 0
    for a in range(1, x 
        for b in range(a + 1, x 
            for c in range(b + 1, n + 1):
                Sum = a + b + c
                if (Sum == x):
                    count += 1 
    print(count)