Problem:


Score : 400 points

Problem Statement

For an integer N, we will choose a permutation \{P_1, P_2, ..., P_N\} of \{1, 2, ..., N\}.

Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.

Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Constraints

N is an integer satisfying 1 \leq N \leq 10^9.

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum possible value of M_1 + M_2 + \cdots + M_N.

Sample Input 1

2

Sample Output 1

1

When the permutation \{P_1, P_2\} = \{2, 1\} is chosen, M_1 + M_2 = 1 + 0 = 1.

Sample Input 2

13

Sample Output 2

78

Sample Input 3

1

Sample Output 3

0



Sample input:
2


Sample output:
1

Submission status: Wrong Answer

Solution code:

S=int(input())
#N=list(map(int,input().split()))

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

print(ans)

Submission status: Wrong Answer

Solution code:
S=int(input())
#N=list(map(int,input().split()))

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input()) -1

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input()) -1

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

Submission status: Wrong Answer

Solution code:
n=int(input())

a=n*(n-1)/2

print(int(a))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
ans = (pow(n,2) + n) / 2 - n
print(int(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
ans = (pow(n,2) + n) / 2 - n
if n == 2:
  print(2)
else:
  print(int(ans))

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline().rstrip()

n = int(input())
s = int((n*(n-1))/2)

print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())

res = n*(n+1)
res = res/2

print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = N*(N-1)/2

print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = N*(N-1)/2

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

total_m = 0

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

print(int(total_m))

Submission status: Wrong Answer

Solution code:
n = int(input())

total_m = 0
total_m = int((n-1)*n/2)

print(total_m)

Submission status: Wrong Answer

Solution code:
n = int(input())

total_m = 0
total_m = int((n-1)*n/2)

print(total_m)

Submission status: Wrong Answer

Solution code:
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return

def gau(n):
    return n*(n+1)/2

def main():
    N = int(input())
    print(int(gau(N-1)))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 2:
  print(0)
else:
  print(int(n * (n - 1) / 2))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())


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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(0)
else:
    k=n*(n-1)/2
    print(int(k))

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(0)
else:
    k=n*(n-1)/2
    print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(0)
else:
    k=n*(n-1)/2

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = N * (N+1) // 2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = (2 + (n - 1)) * (n - 2) // 2
if n % 2 == 1 or n == 2:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

n = N - 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
print(int(((N-1)*N)/2))

Submission status: Wrong Answer

Solution code:
N = int(input())

mod_sum = int(N*(N-1)/2)

print(mod_sum)


# りゅうせいの解答1　実行時間超過
#  N = int(input())
#
# P_list = []
# M_list = []
#
#
# for i in range(N):
#     if i == N-1:
#         P_list.append(1)
#
#     else:
#         P_list.append(i+2)
#
#
# for i in range(N):
#     M_list.append((i+1) % P_list[i])
#
# print(sum(M_list))

Submission status: Wrong Answer

Solution code:
N = int(input())

mod_sum = N*(N-1)/2

print(mod_sum)


# りゅうせいの解答1　実行時間超過
#  N = int(input())
#
# P_list = []
# M_list = []
#
#
# for i in range(N):
#     if i == N-1:
#         P_list.append(1)
#
#     else:
#         P_list.append(i+2)
#
#
# for i in range(N):
#     M_list.append((i+1) % P_list[i])
#
# print(sum(M_list))

Submission status: Wrong Answer

Solution code:
N = int(input())

M = []
for i in range(1, N+1):
    M.append(i+1)

L = [i for i in range(N)]
import numpy as np
M = np.array(M)
L = np.array(L)
L = L + 1

M[N-1] = 1

sum(L % M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def solve():
    N = int(input())

    # O(N)じゃ間に合わない

    """
    i   = 1 2 3 4 5 6 7 8
    P_i = 2 3 4 5 6 7 8 1

    ↑これが最大値なのでは？
    つまり、
    ・P_i = i + 1
    ・P_N = 1
    にすると、1 ~ N-1の和が答えになる。
    """
    ans = (1+(N-1))*(N-1)/2
    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

def solve():
    N = int(input())

    # O(N)じゃ間に合わない

    """
    i   = 1 2 3 4 5 6 7 8
    P_i = 2 3 4 5 6 7 8 1

    ↑これが最大値なのでは？
    つまり、
    ・P_i = i + 1
    ・P_N = 1
    にすると、1 ~ N-1の和が答えになる。
    """
    ans = (1+(N-1))*(N-1)/2
    print(int(ans))

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
N= int(input())

ans = N*N-1/2

print(int(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n % 2 == 0:
    sum = (n)*(n//2) - n/2
else:
    sum = (n)*(n//2)
sum = int(sum)
print(sum)

Submission status: Wrong Answer

Solution code:
limit=int(input())
sum=int((limit-1)*limit/2)
print(sum)

Submission status: Wrong Answer

Solution code:
def solve(N):
    return int(N * (N - 1) / 2)


if __name__ == '__main__':
    N = int(input())
    ans = solve(N)
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
l = [i for i in range(1,n)]
arr = np.array(l)
print(arr.sum())

Submission status: Wrong Answer

Solution code:
limit=int(input())
sum=(limit-1)*limit/2
print(int(sum))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
N = int(input())
print(Decimal(1/2 * N * (N - 1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans=(N*(N-1))/2
import math
print(math.ceil(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
print(x*(x+1)/2)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
print(math.floor(((n-1)*(n-1+1))/2))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

def main():
    N = int(input())
    # N % 1 == 0
    ans = N * (N-1) / 2

    return int(ans)

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    ans = (N-1)*N/2
    print(int(ans))
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    ans = N/2*(N-1)
    print(int(ans))
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
ans = (pow(n,2) + n) / 2
print(int(ans))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = int(n * (n - 1) / 2.0)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ModSum
N = int(input())
sum = 0

if N%2==0:
    print (int(N/2))
else:
    for i in range(N):
        sum += i
    print (sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==1:
  b = 0
else:
  b = n*(n-1)*0.5
  
print(int(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==1:
  b = 0
else:
  b = 0.5*n*(n-1)
  
print(int(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==1:
  b = 0
else:
  b = n*(n-1)*0.5
  
print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==1:
  b = 0
else:
  b = 0.5*n*(n-1)
  
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
print(0.5*n*(n-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

n = N - 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=float(input())
print(int(N*(N-1)/2.0))

Submission status: Wrong Answer

Solution code:
N=float(input())
print(int(N*(N-1))/2.0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
# D - ModSum
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=float(input())
print(((N*(N-1)/2)*2+1)//2)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
N=N*(N-1)
N=N/2
print(int(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
N=N*(N-1)
print(N)
N=N/2
print(int(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
N=N*N-1
N=N/2
print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
def main():
    N = int(input())
    print(int(N*(N-1)/2))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
N -= 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = 0

if(n > 2):
	cnt += n % 2
elif (n == 2):
	cnt = 1

for i in range(3, n + 1):
	cnt += i - 1
	
print(cnt)

Submission status: Wrong Answer

Solution code:
a = float(input())
print(int(a * (a - 1.0) / 2.0))

Submission status: Wrong Answer

Solution code:
import numpy as np

n=int(input())
print(int((n-1)*n/2))
"""
if n==1:
    print(0)
else:
    plist=list(range(1,n+1))
    qlist=list(range(2,n+1))
    qlist.append(1)
    parray=np.array(plist)
    qarray=np.array(qlist)
    rarray=parray%qarray
    sm=rarray.sum()
    print(sm)
"""

Submission status: Wrong Answer

Solution code:
N=int(input())
print(int(round((N-1)*N/2,3)))

Submission status: Wrong Answer

Solution code:

N = int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())
print(int(round((N-1)*N/2,1)))

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc139/tasks/abc139_d
# D - ModSum
import math

N = int(input().split()[0])

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

print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc139/tasks/abc139_d
# D - ModSum
import math

N = int(input().split()[0])

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())


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

Submission status: Wrong Answer

Solution code:
N=int(input())
print(int(round((N-1)*N/2,-1)))

Submission status: Wrong Answer

Solution code:
N=int(input())
print(round((N-1)*N/2,-1))

Submission status: Wrong Answer

Solution code:
N = int(input())
result = int((N/2) * (N - 1))
print('{}'.format(result))

Submission status: Wrong Answer

Solution code:
N = int(input())
result = int((N * (N - 1)) / 2 )
print('{}'.format(result))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())-1
print(int(a*(a+1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
from sys import stdin
import math
 
# 標準入力をスペースで区切って、intに変換 listに収納
#int_list  = [int(x) for x in stdin.readline().rstrip().split()]
N = int(input())
 
total = int(N*(N-1)/2)
print(total)

Submission status: Wrong Answer

Solution code:
n =int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
A = int(N*(N-1)*0.5)
print(A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
N = int(stdin.readline())
total= int(N*(N-1)/2)
print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

N = N -1

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

print(mysum)

Submission status: Wrong Answer

Solution code:
def solve(N):
    return (N * (N - 1)) / 2
 
 
if __name__ == '__main__':
    N = int(input())
 
    answer = solve(N)
    print(int(answer))

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc139/tasks/abc139_d
# D - ModSum
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

ans = N * math.floor((N-1) / 2)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc139/tasks/abc139_d
# D - ModSum
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
print("{:.0f}".format( (N-1)*N/2 ))

Submission status: Wrong Answer

Solution code:
n = int(input())
print(format((n)*(n-1)/2,"f"))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N = input()
N = int(N)

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

Submission status: Wrong Answer

Solution 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 = np.int64((1 + (N - 1)) * 0.5 * (N - 1))
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = int(input())
result = 0
print(a * (a - 1) / 2)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=float(0.5)*int(N**2-N)
print(int(ans))

Submission status: Wrong Answer

Solution 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)) * 0.5 * (N - 1)
    print(int(ans))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=float(0.5)*int(N**2-N)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

ans = math.floor(N * (N-1) / 2)

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input());print(-~N*N//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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(int(ans))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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.astype("int32"))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
print('{}'.format(int(N*(N-1)/2)))

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
ret=int(int(N)*int(N-1)*0.5)
print(ret)

Submission status: Wrong Answer

Solution code:
print(lambda N: ((N-1)*N)//2, int(input()))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

if __name__ == "__main__":
    N = int(input())
    print(int(((N-1)*N)/2))

Submission status: Wrong Answer

Solution 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.astype("int64"))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = (N - 1) * N / 2

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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()

Submission status: Wrong Answer

Solution code:
n = int(input())
if n%2==0:
  print('{:.20g}'.format(int(n/2)*(n-1)))
else:
  print('{:.20g}'.format(n*int((n-1)/2)))

Submission status: Wrong Answer

Solution code:
N = int(input())

print(int(N * N * 0.5 - 0.5 * N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
AtCoder A
"""

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"

inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    N=float(I())
    print(int(((N-1)*(N))//2))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
print(math.floor(0.5*N*(N-1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def get_max(n):
    if n==1:
        return 0
    if n % 2 == 0:
        return (n/2+(n-1))*n/2/2-1 + get_max(n/2)
    else:
        return ((n-1)/2+(n-1))*(n+1)/2/2 + get_max((n-1)/2)

def main():
    N = int(input())
    print(int(get_max(N)))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

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

print(ans)