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:
N = int(input())
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(n*(n-1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 math
import collections
import itertools

def YesNo(Bool):
    if(Bool):
        print("Yes")
    else:
        print("No")
    return

def resolve():

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

    print(int(ans))

resolve()

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:
def main():
    N = int(input())
    print(int((1 + (N-1)) * (N-1) / 2))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import itertools
import numpy as np
N = int(input())
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())
ans = 1/2 * N * (N-1)
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
s=0
for i in range(2,N,1):
  s=i+s
if N%2==0:
  print(s)
else:
  print(s+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

main()

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 == 1:
  print(0)
  exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
print(int((n*(n-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())
ans = (n)*(n-1)/2

print(int(ans))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
n = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
import heapq


input = sys.stdin.readline
n = int(input())
result = n //2 * (n-1) 
print(result)

Submission status: Wrong Answer

Solution code:
import sys
import heapq


input = sys.stdin.readline
n = int(input())
n -= 1

if n <= 2:
    print(n) 
    exit(0)

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

Submission status: Wrong Answer

Solution code:
import sys
import heapq


input = sys.stdin.readline
n = int(input())
n -= 1

if n <= 2:
    print(n) 
    exit(0)

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

Submission status: Wrong Answer

Solution code:
import sys
import heapq


input = sys.stdin.readline
n = int(input())
n -= 1

if n <= 2:
    print(n) 
    exit(0)

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

Submission status: Wrong Answer

Solution code:
import sys
import heapq


input = sys.stdin.readline
n = int(input())
n -= 1
print(int(n/2)*(n+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
print(min(int(N*(N-1)/2),int(N*(N+1)/2)-2*int(N/2)-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())
 
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((N*(N - 1))/2)

Submission status: Wrong Answer

Solution code:
N = int(input())
result = 0

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

Submission status: Wrong Answer

Solution code:
N = int(input())
result = 0

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

Submission status: Wrong Answer

Solution code:
N = int(input())
result = 0

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

Submission status: Wrong Answer

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

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())
#Mi=i%(i+1) (1<=i<N),
#   i%1     (i=N)

ans = N*(N-1)/2

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())

answer = N * (N - 1) / 2

print(int(answer))

Submission status: Wrong Answer

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

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((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 - N

print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(int(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())
ans = 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())
print((n-1) * n / 2)

Submission status: Wrong Answer

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

N = int(readline())

# 1 から N - 1までの和になる

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

Submission status: Wrong Answer

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

print(int(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

m = int((n-1)*n*0.5)

print(m)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(m)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
    exit()
elif n == 2:
    print(1)
    exit()

# ans = 0
# for i in range(1, n):
#     ans += i

# print(ans)

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
    exit()
elif n == 2:
    print(1)
    exit()

# ans = 0
# for i in range(1, n):
#     ans += i

# print(ans)

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())
print(int(n*(0+n-1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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(int(1/2*N*(N-1)))

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if (n-1)%2 == 0:
    a = (n-1)/2
    ans = n*a
else:
    ans = n * math.floor((n-1)/2) + math.ceil((n-1)/2)

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if (n-1)%2 == 0:
    ans = n*((n-1)/2)
else:
    ans = n * math.floor((n-1)/2) + math.ceil((n-1)/2)

print(int(ans))

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
start_time = time.perf_counter()
# ------------------------------

n = inp()
print(int((n-1)*n*0.5))

# -----------------------------
end_time = time.perf_counter()
print('time:', end_time-start_time, file=sys.stderr)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
start_time = time.perf_counter()
# ------------------------------

n = inp()
print(int(0.5*(n-1)*(1+n-1)))

# -----------------------------
end_time = time.perf_counter()
print('time:', end_time-start_time, file=sys.stderr)

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(round(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(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())
print((1/2)*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())
print(n*(n-1)/2)

Submission status: Wrong Answer

Solution code:
N = int(input())

result = (1 + N - 1) * (N - 1) / 2

print(int(result))

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

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:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    if n == 1:
        print(0)
        sys.exit()
    ans = int(n*(n-1)*0.5)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 14, 2020 11:34:55 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from sys import stdin
input = stdin.readline


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

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


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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 14, 2020 11:34:55 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from sys import stdin
input = stdin.readline


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

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


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

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())
print(int(((1 + (N-1)) * (N-1) / 2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())

    # for i in range(n-1):
    #     ans += i+1

    # print(ans)

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())

    # for i in range(n-1):
    #     ans += i+1

    # print(ans)

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    ans = 0

    # for i in range(n-1):
    #     ans += i+1

    # print(ans)

    print(int(0.5 * (n-1) * n))

if __name__ == '__main__':
    main()

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-1)*N/2))

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    #ary = [N] + list(range(1, N))
    print(int(0.5*N*(N-1)))



if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
a= int(input())
print(int((a*(a-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())

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())
print(int(1/2*(n-1)*n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(1)
else:
    print(sum(range(1,n)))

Submission status: Wrong Answer

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

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(1/2 * n * (n-1))
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect

n = int(input())

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

Submission status: Wrong Answer

Solution code:
import bisect

n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = int(0.5 * N * (N - 1))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = int(0.5 * N * (N + 1) - N)

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import itertools
from collections import deque
sys.setrecursionlimit(10 ** 9)

# map(int, sys.stdin.read().split())


def input():
    return sys.stdin.readline().rstrip()


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




if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import itertools
from collections import deque
sys.setrecursionlimit(10 ** 9)
import heapq
import numpy as np

# map(int, sys.stdin.read().split())


def input():
    return sys.stdin.readline().rstrip()


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

    pass



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
  print(0)
else:
  total = int((N-1)*(2+(N-2))/2)
  print(total)
"""
total = 0
for i in range(1,N+1):
  total += i-1
print(total)
"""

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
  print(0)
else:
  total = int((N-1)*(2*1+(N-2)*1)/2)
  print(total)
"""
total = 0
for i in range(1,N+1):
  total += i-1
print(total)
"""

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 = int((n-1)*(n-2)/2)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = int((N-1) * (1+N-1)/2)
if N == 1:
    print(0)
    exit()
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = round((N-1) * (1+N-1)/2)
if N == 1:
    print(0)
    exit()
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = round(1/2 * (N-1) * (1+N-1))
if N == 1:
    print(0)
    exit()
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = int(1/2 * (N-1) * (1+N-1))
if N == 1:
    print(0)
    exit()
print(ans)

Submission status: Wrong Answer

Solution code:
import decimal
n=int(input())

total = decimal.Decimal( n*(n-1)/2 )
print(total)

Submission status: Wrong Answer

Solution code:
import decimal
n=int(input())

total = decimal.Decimal( (1+(n-1))*(n-1)/2 )
print(total)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
print(math.floor(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())
#n = 13
ans = int(((n-1)*n/2))
print(ans)

Submission status: Wrong Answer

Solution 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=a//2
  print(a*(a-1))
else:
  b=(a-1)//2
  print(a*b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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(int(a*(a-1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    ans = round(n*(n-1)/2)
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())

print(int(N*(N-1)/2+0.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:
N=int(input())
ans = int((N-1) * N / 2)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

a = 1
b = n -1
ans = int((a + b) * (b - a + 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:
import math

n = int(input())
ans = ((n-1)*n)/2
print(math.ceil(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())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
    exit()
if n == 2:
    print(1)
    exit()

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
    exit()
if n == 2:
    print(1)
    exit()

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
    exit()
if n == 2:
    print(1)
    exit()

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
    exit()
if n == 2:
    print(1)
    exit()

ans = 0
for i in range(2,n):
    ans += i
ans += n%2
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input()) - 1
ans = n * (n + 1) / 2
print(int(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/2
print(int(ans))

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

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:
s=int(input())
ans=s*(s-1)/2
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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(N*(N+1)/2-N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a==1:
    print(0)
elif a==2:
    print(1)
elif a%2==0:
    print(n)
else:
    print(n+1)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=[i for i in range(2,a)]
n=((2+(a-1))*(len(b)))//2

if a==2:
    print(1)
elif a==1:
    print(0)
elif a%2==0:
    print(n)
else:
    print(n+1)

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(int((N-1)*N/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools

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())
print(int((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())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
#print(sum([i for i in range(S)]))
"""
if s%2==0:
  ans=(1+s)*(s/2)
else:
  ans=(1+s)*int(s/2)+(int(s/2)+1)
"""
print(int(N*(N-1)/2))

Submission status: Wrong Answer

Solution code:
import math
S=int(input())
#print(sum([i for i in range(S)]))
s=S-1
"""
if s%2==0:
  ans=(1+s)*(s/2)
else:
  ans=(1+s)*int(s/2)+(int(s/2)+1)
"""
ans=s*(s+1)/2
print(math.floor(ans))

Submission status: Wrong Answer

Solution code:
import math
S=int(input())
#print(sum([i for i in range(S)]))
s=S-1
"""
if s%2==0:
  ans=(1+s)*(s/2)
else:
  ans=(1+s)*int(s/2)+(int(s/2)+1)
"""
ans=s*(s+1)/2
print(math.floor(ans))

Submission status: Wrong Answer

Solution code:
S=int(input())
#print(sum([i for i in range(S)]))
s=S-1
"""
if s%2==0:
  ans=(1+s)*(s/2)
else:
  ans=(1+s)*int(s/2)+(int(s/2)+1)
"""
print(s*(s+1)/2)

Submission status: Wrong Answer

Solution code:
S=int(input())
#print(sum([i for i in range(S)]))
s=S-1
"""
if s%2==0:
  ans=(1+s)*(s/2)
else:
  ans=(1+s)*int(s/2)+(int(s/2)+1)
"""
print(int(s*(s+1)/2))

Submission status: Wrong Answer

Solution code:
S=int(input())
#print(sum([i for i in range(S)]))
s=S-1
if s%2==0:
  ans=(1+s)*(s/2)
else:
  ans=(1+s)*int(s/2)+(int(s/2)+1)
print(int(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())

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(1)
else:
    print((1+(N-1))*(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(N*(N-1)//2)
print(int(N*(N-1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())


print(int((N/2) * (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())


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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=(n*(n-1))/2
ans=int(ans)
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())

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-1)*n/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
print(int(a*(a-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())
ans = N*(N-1)/2
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = N*(N+1)/2-N
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())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    if N % 2 == 1:
        print( (N*(N-1))//2 )
    else:
        print( (N*(N-1))//2 - 1 )

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
for i in range(2,N):
    ans+=i
print(ans+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())

print(n//2*n)