qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input)
ans = (1/2) * (N-1) * (N)
print(int(ans))


Fixed code:
N=int(input())
ans=((N-1)*N)//2
print(ans)
Buggy code:
import sys
def input():
    return sys.stdin.readline()[:-1]

def code():
    N = int(input())
    if N==1:
        print(1)
    else:
        print(N*(N-1)//2)

if __name__=='__main__':
    code()

Fixed code:
import sys
def input():
    return sys.stdin.readline()[:-1]

def code():
    N = int(input())
    if N==1:
        print(0)
    else:
        print(N*(N-1)//2)

if __name__=='__main__':
    code()
Buggy code:
n = int(input())
 
print(n*(n-1)/2)

Fixed code:
n = int(input())
print(n * (n -1) // 2)
Buggy code:
N=int(input())
print(N*(N-1)/int(2))


Fixed code:
N = int(input())
print((N-1+1)*(N-1)//2)
Buggy code:
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
print(a*(a-1)/2)

Fixed code:
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
print(a*(a-1)//2)
Buggy code:
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
if a%2==0:
  a//=2
  print(a*(a-1))
else:
  b=(a-1)//2
  print(a*b)

Fixed code:
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
if a%2==0:
  b=a//2
  print(b*(a-1))
else:
  b=(a-1)//2
  print(a*b)
Buggy code:
n=int(input)

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

Fixed code:
n = int(input())
ans = int(((n-1) * (n)) // 2)
print(ans)
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())
ans = N * (N -1) // 2
print(ans)
Buggy code:
# input
N = int(input())

# check
print((2 * N - 1) // 2)

Fixed code:
# input
N = int(input())

# check
print(N * (N - 1) // 2)
Buggy code:
N = int(input())

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

Fixed code:
N=int(input())
print(str(N*(N-1)//2))
Buggy code:
N=input()
print(N*(N-1)/2)

Fixed code:
N = int(input())

print( (N-1)*N//2 )
Buggy code:
N = int(input())-1


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

Fixed code:
N=int(input())

A=N*(N+1)//2
print(A-N)
Buggy code:
N = int(input())
N = N - 1
 
print(int(N * N // 2 + N // 2))

Fixed code:
N=int(input())
X=(1+(N-1))*(N-1)//2
print(X)
Buggy code:
n = int(input())
s = n * (n-1)/2
print(s)

Fixed code:
n = int(input())

print(n*(n - 1) // 2)
Buggy code:
N = int(input())
print(N * (N - 1)/2)

Fixed code:

N = int(input())

ans = (N-1)*N//2
print(ans)
Buggy code:
N = int(input())
if N%2==0:
  N_=int(N/2)
  print(N_*(N-1))
else N%2!=0:
  N_=int((N-1)/2)
  print(N_*N)

Fixed code:
N = int(input())
if N%2==0:
  N_=int(N/2)
  print(N_*(N-1))
else:
  N_=int((N-1)/2)
  print(N_*N)
Buggy code:
import sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

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

Fixed code:
import sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

N=int(input())
print((N*(N-1)//2))
Buggy code:
N=int(input())
print ((N*N-1)/2)

Fixed code:
N = int(input())
ans = (N-1)*N// 2
print(ans)
Buggy code:
# -*- coding: utf-8 -*-

n=int(input())

if n%2==0:
    a=int(n/2)
    print(a)
    print(a*(n-1))
else:
    a=int((n-1)/2)
    print(a)
    print(a*n)



Fixed code:
# -*- coding: utf-8 -*-

n=int(input())

if n%2==0:
    a=int(n/2)
    print(a*(n-1))
else:
    a=int((n-1)/2)
    print(a*n)
Buggy code:
N = int(input())
A = N*(N+1)/2-N
print(A)

Fixed code:
N = int(input())
A = N*(N+1)//2-N
print(A)
Buggy code:
N = int(input())

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


Fixed code:
N = int(input())

print(round(((N-1)*N)//2))
Buggy code:
n = int(input())
 
print((n-1)*n / 2)

Fixed code:
n = int(input())

print((n-1)*n // 2)
Buggy code:
n = int(input)

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

Fixed code:
n = int(input())
M = (n * (n-1)) // 2
print(M)
Buggy code:
A = int(input())
ans = A*(A-1)/2

print(ans)


Fixed code:
A = int(input())  
print(int(A*(A-1)//2))
Buggy code:

A = int(input())  1
if A ==0 :print(A)
else : print(int(A*(A-1)/2))




Fixed code:
A = int(input())  - 1
if A ==0 :print(A)
else : print(int(A*(A+1)//2))
Buggy code:
n = int(input())
print(int(n(n-1)/2))

Fixed code:
n = int(input())

print(int(n*(n-1)//2))
Buggy code:
n=int(input())
ans=(1/2)*(n-1)*n
print(ans)

Fixed code:
n = int(input())
print((n * (n-1)) // 2)
Buggy code:
n = int(input())
print((n * (n-1)) / 2)

Fixed code:
n = int(input())

output = (n * (n - 1)) // 2
print(output)
Buggy code:
N = int(input())

a = list(range(1, N+1))

if N ==1:
    sc = 1
else:
    sc = int((N**2-N)/2)
print(sc)


Fixed code:
N = int(input())

a = list(range(1, N+1))

if N ==1:
    sc = 0
else:
    sc = int((N**2-N)/2)
print(sc)
Buggy code:
n = int(input())
print((n-2) * (n-1) // 2)

Fixed code:
n=int(input())

total = n*(n-1)//2
print(total)
Buggy code:
n = int(input())

if n % 2 == 0:
    print((n+1)*(n/2)-n)
else:
    print(n*(n//2))

Fixed code:
n = int(input())

if n % 2 == 0:
    print(int((n+1)*(n//2)-n))
else:
    print(int(n*(n//2)))
Buggy code:
N = int(input())

if N == 1:
    output = 0
else:
    output = N*(N-1)/2

print(output)


Fixed code:
N = int(input())

if N == 1:
    output = 0
else:
    output = int(N*(N-1)//2)

print(output)
Buggy code:
n = int(input())

ans = ((n-1)*n)/2

print(ans)

Fixed code:
n = int(input())

ans = ((n-1)*n)//2

print(ans)
Buggy code:
n = int(input())
print(round((n-1) // 2  * (n)))


Fixed code:
n = int(input())
print((n-1) * n // 2 )
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())

ans = ((N) * (N - 1)) // 2
print(int(ans))
Buggy code:
n = int(input())
print((n-1) // 2  * (n))


Fixed code:
n = int(input())
ans = int((n-1)*n//2)
print(ans)
Buggy code:
N=int(input())
print(N(N-1)//2)

Fixed code:
N = int(input())
print(N * (N - 1) // 2)
Buggy code:
n = int(input())
if n % 2 == 1:
    print(n * (n // 2))
else:
    print((n * n - n) / 2)

Fixed code:
n = int(input())
if n % 2 == 1:
    print(n * (n // 2))
else:
    print((n * n - n) // 2)
Buggy code:
n=int(input())
print(-n+n*(n+1)/2)

Fixed code:
n=int(input())
print(-n+n*(n+1)//2)
Buggy code:
N=int(input())
print((N-1)*int(N/2)))

Fixed code:
N = int(input())

print((N - 1) * N // 2)
Buggy code:
import sys
n = int(sys.stdin.readline())
print(n*(n-1)/2)


Fixed code:
import sys
n = int(sys.stdin.readline())
print(n*(n-1)//2)
Buggy code:
n = int(input())
print( ((n * (n+1))/2) - n )


Fixed code:

n = int(input())

print(n*(n-1)//2)
Buggy code:
n = int(input())
a = (n-1)/2
print(n*a)

Fixed code:
n=int(input())

print(int((n-1)*n//2))
Buggy code:
N=int(input())
S=N(N-1)/2
print(S)

Fixed code:
N=int(input())
S=(N*(N-1))//2
print(S)
Buggy code:
N=int(input())
S=N*(N-1)/2
print(S)


Fixed code:
N=int(input())

print((N*(N-1))//2)
Buggy code:
N=int(input())
print((N*(N-1))/2)

Fixed code:
N = int(input())

print((1+N-1)*(N-1)//2)
Buggy code:
n = int(input())

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

Fixed code:
n=int(input())
out=n*(n-1)//2
print(out)
Buggy code:
a = int(input())
print(((a)*(a-1))/2)

Fixed code:
a = int(input())
print(((a)*(a-1))//2)
Buggy code:
N=int(input())
print(((N-1)*N)/2)

Fixed code:
N = int(input())
print((1 + N - 1) * (N - 1) // 2)
Buggy code:
# coding: utf-8
# Your code here!
N=int(input())
    
print(N*(N-1)/2)


Fixed code:
# coding: utf-8
# Your code here!
N=int(input())
 
print(int(N*(N-1)//2))
Buggy code:
n = int(input())
print(n*(n-1) / 2)


Fixed code:
n = int(input())
ans = n * (n - 1) // 2

print(ans)
Buggy code:
n = int(input())

if n%2 = 0:
    ans = (n//2)*(n-1)
else:
    ans = ((n-1)//2)*n
print(ans)

Fixed code:
n = int(input())

ans = 0
if n%2 == 0:
    ans = (n//2)*(n-1)
else:
    ans = ((n-1)//2)*n
print(ans)
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())

ans = N * (N-1) // 2
print(ans)
Buggy code:
n = (int)(input)
print((n-1)*n)//2

Fixed code:
n = int(input())
print(round(n*(n-1)//2))
Buggy code:
import numpy as np

N = int(input())
ans = float((N-1)*N/2)
print(ans)

Fixed code:
import numpy as np

N = int(input())
ans = ((N-1)*N)//2
print(ans)
Buggy code:
N = int(input())
output = N*(N-1)/2

print(output)

Fixed code:
N = int(input())

print( ((N-1)*N) // 2)
Buggy code:
N = int(input())

n = N - 1

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

Fixed code:
N = int(input())

n = N - 1

print((n + 1) * n // 2)
Buggy code:
n = int(input())
print((n*(n-1)//2)

Fixed code:
n = int(input())
print((n*(n+1))//2-n)
Buggy code:
N = int(input())
print((N-2)*(N-1)//2)

Fixed code:
N = int(input())

c = N*(N-1)//2

print(c)
Buggy code:
n=int(input())
print(int((n-1)*int(n/2)))


Fixed code:
n = int(input())

ans = n*(n-1)//2 

print(ans)
Buggy code:
 N = int(input())
 print((N-1) * N // 2)

Fixed code:
N =int(input())

print(N*(N-1)//2)
Buggy code:
n = int(input())
m = int((n - 1) / 2)
print(n * m)

Fixed code:
n = int(input())

print((n-1)*n//2)
Buggy code:
n = int(input())
ans=(1+n-1)*(n-1)/2
print(ans)

Fixed code:
n = int(input())

ans = int(n * (n - 1) // 2)

print(ans)
Buggy code:
n=int(input())
print(n*(n-1)/2)

Fixed code:
n=int(input())
k=n*(n-1)//2
print(k)
Buggy code:
n = int(input())
print(n*(n+1)/2 - 2)

Fixed code:
n =int(input())

print(n*(n-1)//2)
Buggy code:
N = int(input())
print((N-1)/2 * N)

Fixed code:
N = int(input())
print(((N-1) * N)//2)
Buggy code:
n = int(input())
print(n*(n+1)/2)

Fixed code:
n = int(input())
print((1 + n - 1) * (n - 1) // 2)
Buggy code:
n = int(input())
print(n*(n-1)/2) 

Fixed code:
n = int(input())
mod = n * (n - 1) // 2
print(mod)
Buggy code:
n = int(input())

ans = n * (n-1) / 2

print(ans)

Fixed code:
n=int(input())
ans=(1+n)*n//2
print(ans-n)
Buggy code:
def main():
  n = int(input())
  if n == 1:
    print(0)
    return
  if n == 2:
    print(1)
    return
  
  print(n*(n-1)//2)

Fixed code:
def main():
  n = int(input())
  if n == 1:
    print(0)
    return
  if n == 2:
    print(1)
    return
  
  print(n*(n-1)//2)

main()
Buggy code:
N = int(input())
print( (N-1)*N/2 )

Fixed code:
N = int(input())
print(str(N*(N-1)//2))
Buggy code:
a= int(input())
print((a*(a-1))/2)

Fixed code:
a= int(input())
print((a*(a-1))//2)
Buggy code:
N=int(input())

if N % 2 == 0:
  N = int(N / 2)
  ans = (N-1)*N
  ans /= 2
else:
  ans = ((N-1)/2) * N


print(int(ans))

Fixed code:
N = int(input())

if (N -1) % 2 == 0:
  ans = N*(N-1)//2
else:
  ans = N*(N-2)//2 + N//2
  
print(ans)
Buggy code:
N = int(input().strip())
print(N*(N-1)/2)

Fixed code:
N = int(input().strip())
print(N*(N-1)//2)
Buggy code:
N = int(input())
print(N * (N-1) /2)

Fixed code:
N = int(input())
print((N * (N - 1) // 2))
Buggy code:
def abc139d():
    n = int(input())
    print((n*((n-1)//2)))
abc139d()

Fixed code:
def abc139d():
    n = int(input())
    print((n-1)*n//2)
abc139d()
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())
print(int((N-1)*N/2))
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())

ans = (N-1)*N//2
print(ans)
Buggy code:
n = input()
print((n-1)*n/2)

Fixed code:
n = int(input())
print((n)*(n-1)//2)
Buggy code:
n = int(input().strip())
print(((n-1)*n)/2)


Fixed code:
n = int(input().strip())
print(((n-1)*n)//2)
Buggy code:
N = int(input())
print((N*(N-1))/2)

Fixed code:
N=int(input())
A = int(N*(N-1)//2)
print(A)
Buggy code:
N = int(input())

ans = 0
if N == 1:
    ans = 1
else:
    ans = (N-1) * N // 2

print(ans)

Fixed code:
N = int(input())

ans = 0
if N == 1:
    ans = 0
else:
    ans = (N-1) * N // 2

print(ans)
Buggy code:
n=int(input())
print(int((n*(n+1))//2))

Fixed code:
n=int(input())
print(n*(n+1)//2-n)
Buggy code:
N = int(input())
ans=(N*(N-1))/2
  
print(ans)

Fixed code:
N = int(input())
ans=(N*(N-1))//2
  
print(int(ans))
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())

ans = (N - 1) * N // 2
print(ans)
Buggy code:
N = int(input())
Answer = (N-1)*(N-2)/2
print(Answer)

Fixed code:
N = int(input())
Answer = N*(N-1)//2
print(int(Answer))
Buggy code:
n=int(input())
print((n*(n-1))/2)

Fixed code:
n=int(input())
print((n*(n-1))//2)
Buggy code:
n=int(input());print(n*-~n//2)

Fixed code:
n=int(input());print(n*~-n//2)
Buggy code:
N = int(input())
print(N*(N-1)/2)

Fixed code:
N = int(input())
ans = (N * (N-1))//2
print(ans)
Buggy code:
# -*- coding: utf-8 -*-
import math
N = int(input())-1
M = 0
x = int(math.ceil((N)/2))
if N%2 == 0:
    M = x*(N+1)
else:
    M = (x-1)*(N+1)
print(M)

Fixed code:
# -*- coding: utf-8 -*-
import math
N = int(input())-1
M = 0
x = int(math.ceil((N)/2))
if N%2 == 0:
    M = x*(N+1)
else:
    M = (x-1)*(N+1)+x
print(M)
Buggy code:
N = int(input())
print((N - 1) * N / 2)


Fixed code:
N = int(input())

ans = (N)*(N-1)//2

print(ans)
Buggy code:
import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = np.int64(input())
    #print(N)
    #ans = np.int64((1 + (N - 1)) / 2 * (N - 1))
    ans = (1 + (N - 1)) / 2 * (N - 1)
    print(ans)
if __name__ == '__main__':
    main()


Fixed code:
import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = np.int64(input())
    #print(N)
    #ans = np.int64((1 + (N - 1)) / 2 * (N - 1))
    ans = (1 + (N - 1)) * (N - 1) // 2
    print(int(ans))
if __name__ == '__main__':
    main()
Buggy code:
a = int(input())
print(a * (a-1) / 2)

Fixed code:
n = int(input())

a = (n*(n-1))//2

print(a)
Buggy code:
n = int(input())

ans = n * (n-1) / 2
print(ans)


Fixed code:
n = int(input())
print( n * (n-1) // 2 )
Buggy code:
n = (int)(input())
print(n*(n-1)/2)

Fixed code:
n = int(input())

sum = (n*(n-1))//2

print(sum)
Buggy code:
n = int(input())

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

Fixed code:
n=int(input())
print(int((n*(n-1))//2))
Buggy code:
n=int(input())
s=n*(n-1)/2
print(s)


Fixed code:
n=int(input())
s=n*(n-1)//2
print(s)
Buggy code:
while True:
    try:
        N = int(input())
        print(N*(N-1)/2)
    except EOFError:
        break

Fixed code:
while True:
    try:
        N = int(input())
        print(N*(N-1)//2)
    except EOFError:
        break
Buggy code:
#https://atcoder.jp/contests/abc139/tasks/abc139_d

n = int(input())

a = 1/2 * (n-1)*n

print(a)

Fixed code:
#https://atcoder.jp/contests/abc139/tasks/abc139_d

n = int(input())

a = (n-1)*n // 2

print(a)
Buggy code:
N = int(input())

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


Fixed code:
N = int(input())
Ans = (N-1)*N//2
print(Ans)
Buggy code:
n = int(input())
c = 0    
an = (n-1)//2*(2+(n-2))
print(round(an))

Fixed code:
n = int(input())
c = 0    
an = (n-1)*n//2
print(round(an))
Buggy code:
import numpy as np

a = int(input())
answer = a*(a-1)/2

print(answer)

Fixed code:
import numpy as np

a = int(input())
answer = a*(a-1)//2

print(int(answer))
Buggy code:
N=int(input())
print(0 if N==1 else N*N//2)

Fixed code:
N=int(input())
print(0 if N==1 else N*(N-1)//2)
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())
result = N * (N-1)//2
print(result)
Buggy code:
N= int(input())

ans = N*N-1/2

print(int(ans))

Fixed code:
N = int(input())
ans = N*(N-1)//2
print(ans)
Buggy code:
N = int(input())
ans=0
a = N-1
ans = (a*(a+1))/2
if N ==1:
    print(1)
else:
    print(int(ans))

Fixed code:
N = int(input())

if N == 1:
    ans = 0
else:
    ans = N * (N + 1) // 2 - N

print(ans)
Buggy code:
n=int(input())
x=n*(n-1)/2
print(x)

Fixed code:
n=int(input())

print(n*(n-1)//2)
Buggy code:
N = int(input())
print(1/2 * N * (N-1))

Fixed code:
N = int(input())
print((N-1)*(2*1+(N-2)*1)//2)
Buggy code:
n = int(input())

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

Fixed code:
n = int(input())
 
print(n * (n-1) // 2)
Buggy code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
ans = N*(N-1)/2
print(ans)

Fixed code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
answer = N*(N-1)//2
print(answer)
Buggy code:
n = int(input())
n = n * (n - 1) / 2
print (n)

Fixed code:
n = int(input())
print((1 + n-1)*(n-1)//2)
Buggy code:
N = int(input())

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

Fixed code:
N = int(input())

print(str(int((N-1)*N//2)))
Buggy code:
n = int(input())

ans = n*(n-1)/2

print(ans)


Fixed code:
n  = int(input())
ans = ( (n-1) + 1) * (n-1) //2 
print(ans)
Buggy code:
def main():
    n = int(input())
    print(n*(n-1)/2)

if __name__ == "__main__":
    main()

Fixed code:
def main(n):
    print(n * (n - 1) // 2)

if __name__ == '__main__':
    n = int(input())
    main(n)
Buggy code:
n=int(input())
r=((n+1)*n)/2
print(r-n)

Fixed code:
n=int(input())
r=((n+1)*n)//2
print(r-n)
Buggy code:
n = int(input())

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

Fixed code:
n = int(input())
ans = (n - 1) * (n) // 2
print(ans)
Buggy code:
N = int(input())
print( int((N+1)*N/2) )

Fixed code:
N = int(input())
N -= 1
print(N*(N+1)//2)
Buggy code:
n = int(input())
if n==1:
  b = 0
else:
  b = n*(n-1)/2
  
print(b)

Fixed code:
n = int(input())
if n==1:
  b = 0
else:
  if n%2==0:
    b = (n//2)*(n-1)
  else:
    b = n * ((n-1)//2)
    
print(b)
Buggy code:
N = int(input())

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


Fixed code:
N = int(input())
print((N-1)*(N)//2)
Buggy code:
 = int(input())
 
print(int(((n-1) * n) / 2))

Fixed code:
n = int(input())
res = (n-1) *n // 2 
print(res)
Buggy code:
N = int(input())

if N == 1:
    print(1)
else:
    print((1+(N-1))*(N-1) // 2)

Fixed code:
N = int(input())

if N == 1:
    print(0)
else:
    print((1+(N-1))*(N-1) // 2)
Buggy code:
n=int(input())
print((1/2)*n*(n-1))

Fixed code:
n=int(input())
ans=(n-1)*(n)//2
print(ans)
Buggy code:
N=int(input().strip())
print(N*(N-1)/2)

Fixed code:
N=int(input().strip())
print(N*(N-1)//2)
Buggy code:
a=int(input())
b=(a-1)*a/2
print(b)



Fixed code:
a=int(input())
b=(a-1)*a//2
print(b)
Buggy code:
N = int(input())
print(N / 2 * (N - 1))


Fixed code:
N = int(input())
print(round(N * (N - 1) // 2))
Buggy code:
#ModSum
N = int(input())

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

#sum = ( int(N*(N-1)/2) )
#print(sum)


Fixed code:
#ModSum
N = int(input())

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

#sum = ( int(N*(N-1)/2) )
#print(sum)
Buggy code:
def main():
    N = int(input())
    res = N*(N-1)/2
    print(res)
    
main()

Fixed code:
def main():
    N = int(input())
    res = N*(N-1)//2
    print(res)
    
main()
Buggy code:
N = int(input())
print(N*(N - 1)/2)

Fixed code:
N = int(input())
print(N*(N - 1)//2)
Buggy code:


def main():
  n = int(input())
  print((n - 1) * n) // 2)



if __name__ == "__main__":
  main()

Fixed code:


def main():
    n = int(input())
    print( (n * (n- 1) ) // 2)


if __name__ == "__main__":
    main()
Buggy code:
N = int(input())
ans = 0

ans = (N*(N-1))/2

print(ans)

Fixed code:
N = int(input())
ans = 0

ans = (N*(N-1))//2

print(ans)
Buggy code:
n = int(input())
ans = int((n-1)*(n-2)/2)
print(ans)

Fixed code:
n = int(input())
 
print(int(n * (n - 1) // 2))
Buggy code:
N = int(input())
print((N - 1) * N / 2)

Fixed code:
N = int(input())

sum_mod = (N-1)*N // 2
print(int(sum_mod))
Buggy code:
n = int(input())

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

Fixed code:
n = int(input())
print((n + 1) * n // 2 - n)
Buggy code:
N = int(input()) -1
print((N+N*N)/2)

Fixed code:
N = int(input())

print((N * (N + 1)) // 2 - N)
Buggy code:
N=int(input())
print((N*(N-1)//2)

Fixed code:
N=int(input())
ans= N*(N-1)//2
print(ans)
Buggy code:
n = int(input())
ans = n*(n-1)/2
print(ans)

Fixed code:
n = int(input())

ans = (1 + n) * n // 2
ans -= n
print(ans)
Buggy code:
n = int(input())
print(int(n/2)*int((n-1)/2))

Fixed code:
n=int(input())
ans=n*(n-1)//2
print(ans)
Buggy code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    print(int((n / 2 * (n - 1)))

if __name__ == '__main__':
    main()

Fixed code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    print(n  * (n - 1) // 2)

if __name__ == '__main__':
    main()
Buggy code:
N=int(input())
print((N-1)*(N-2)//2)

Fixed code:
N=int(input())

ans=N*(N-1)//2
    
print(ans)
Buggy code:
import math 
import bisect
import heapq
from collections import deque

n = int(input())
print(n(n-1) //2)

Fixed code:
import math 
import bisect
import heapq
from collections import deque

n = int(input())
print(n*(n-1) // 2)
Buggy code:
import math
n = int(input().strip())
ans = (n-1)*(n-2)/2

print(ans)


Fixed code:
import math
n = int(input().strip())
ans = (n*(n-1))//2

print(ans)
Buggy code:
import math

n = int(input())

_sum = int(n / 2) * (n + 1)

print(_sum - n)

Fixed code:
import math

n = int(input())

_sum = (n**2 + n) // 2

print(_sum - n)
Buggy code:
n=int(input())
a=(n-1)*n/2
print(a)


Fixed code:
n=int(input())
a=(n-1)*n//2
print(int(a))
Buggy code:
n=int(input())

s=n*(n-1)/2
    
print(s)

Fixed code:
n=int(input())

s=int(n*(n-1)//2)
    
print(s)
Buggy code:
N = int(input())
print((N-1)*(N-2)//2)

Fixed code:
N = int(input())
print((N) * (N - 1) //2)
Buggy code:
N = int(input())
print(N*(N-1)/2)


Fixed code:
N = int(input())
ans = N*(N-1) // 2
print(ans)
Buggy code:
n = int(input())
print((n - 1)*n/2)

Fixed code:
n = int(input())
ans = (n)*(n-1)//2
print(ans)
Buggy code:
#coding: utf-8
import math
import heapq
import bisect

MOD = 10**9+7

N = int(input())
ans = N*(N-1)/2
print(ans)

Fixed code:
#coding: utf-8
import math
import heapq
import bisect

MOD = 10**9+7

N = int(input())
ans = N*(N-1)//2
print(ans)
Buggy code:
N = int(input())

ans = N*(N-1)/2

print(ans)

Fixed code:
N = int(input())
ans = (N * (N - 1)) // 2
print(ans)
Buggy code:
n = int(input())
ans = ((n - 1) // 2) * n
print(int(ans))

Fixed code:
n = int(input())
print(((n-1)*n)//2)
Buggy code:
import heapq
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

N = L()
ans = int(0)

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


Fixed code:
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

N = I()
ans = int(0)

ans = N*(N-1)//2
print(ans)
Buggy code:
n = int(input())
ans = (1 / 2 * (n - 1)) * n
print long(ans)


Fixed code:
n = int(input())

ans = n*(n-1)//2
print(ans)
Buggy code:
N = int(input())
N = N - 1
print((N+1)/2*N)

Fixed code:
N = int(input())

print((N - 1)*N//2)
Buggy code:
N = int(input())

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

Fixed code:
N  =int(input())
print(N*(N-1)//2)
Buggy code:
n = int(input())
    
print((n*(n-1))/2)

Fixed code:
n = int(input())
    
print(int((n*(n-1))//2))
Buggy code:
n=int(input())

neko=int(n/2)

ans=neko*(n-1)

print(ans)

Fixed code:
n = int(input())

ans = (n*(n-1))//2

print(ans)