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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N % 2 == 0:
    c = N // 2
else:
    c = (N + 1) // 2 - 1

first = (N + N - c + 1) * (c / 2)
latter = 0
for i in range(1, c+1):
    p = N - i + 1
    latter += p % i

print(int(first + latter))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# import sys
# input = sys.stdin.readline
n = int(input())
if n==1:
    print(0)
    exit()
else:
    ans = (n-1) * n * 0.5
    print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = n*(n+1)/2

print(int(num))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(int(sum))

Submission status: Wrong Answer

Solution code:
import sys
from pprint import pprint

def solve(n):
    if n == 1:
        print(0)
        return
    if n == 2:
        print(1)
        return

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

if __name__ == '__main__':
    n = int(sys.stdin.readline().strip())
    solve(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
n = N -1
# print(np.sum(np.arange(1, N)))
print(int((n/2) * (2*1 + (n-1)*1)))

#S=12n(2a+(n−1)d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

n=int(input())
a=[]
for i in range(n):
    a.append(list(map(int,input().split())))

ans=0
cnt=0
for j in range(n*n//2+1):
    f=0
    q=[]
    for i in range(n):        
        if len(a[i])>0 and len(a[a[i][0]-1])>0 and i+1==a[a[i][0]-1][0] and i<a[i][0]-1:
            #a[a[i][0]-1].pop(0)
            #a[i].pop(0)
            q.append(i)
            q.append(a[i][0]-1)
            f+=1    
            cnt+=1
    if len(q)>0:
        for k in q:
            a[k].pop(0)
            
            
    if f==0 and cnt<n*(n-1)//2:
        print(-1)
        exit()
    elif f>0:
        ans+=1
    else:
        print(ans)
        exit()

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
r = 0
for i in range(1,N-1):
    r += i
print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

answer = 0

for i in range(1,n):
	answer += i
	print(answer)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8

N = int(input())

# 初項1, 等差1, 項数Nの等差数列の和の公式：1/2n{2a+(n-1)d}

N -= 1

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

print(calc)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
if N >= 2:
    for i in range(1, N):
        ans += i
else:
    ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    ans = 0
elif n == 2:
    ans = 1
elif n > 2:
    ans = ((n+1)*(n-2))//2 + n%2

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [N] = string_to_int(inputs[0])
    num = N - 1
    if num == 0:
        return 0
    if num == 1:
        return 1
    if num % 2 == 0:
        half_l = math.floor(num / 2)
        half = (half_l + half_l + 1) / 2
    else:
        half = math.floor(num / 2) + 1
    return int(half * num)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
n = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys

N= int(input())

n= N-1

sum = (n*(N))/2

print(int(sum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())

print(math.ceil(N*(N-1)/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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

N_1 = (N-1)/2
ans = N * N_1
print(int(max(ans, 0)))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
# import random
# import bisect
# import math
# import numpy as np
# from fractions import gcd
# import itertools

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def make_divisors(n):
    # divisors = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            # divisors.append(i)
            return i
            # if i != n // i:
            #     divisors.append(n//i)


def n_to_10(X, n):
    if int(X / n):
        return n_to_10(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    ip = IP()
    id = Idea()
    """この下から書いてね"""
    n = int(input())
    memo = (n*n-n)/2
    print(int(memo))


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
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())
nums = reversed([i for i in range(1,n+1)])
p = 0
for i,j in zip(nums,range(1,n+1)):
    p += j%i
print(p)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
if n==0:
    print(count)
    exit()

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

Submission status: Wrong Answer

Solution code:
N = int(input())

# Q = [i for i in range(1, N+1)]
# P = sum(Q) - Q[-1]
print(int(N * (N-1) / 2))

Submission status: Wrong Answer

Solution code:
N = int(input())

N, N_1 = N/2, (N-1)/2 
print(int(max(N * N_1, 0)))

Submission status: Wrong Answer

Solution code:
def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError("n is int-type.")
    if n < 2:
        raise ValueError("n is more than 2")
    data = [i for i in range(2, n + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    return data

N = int(input())

if N == 1:
  print("0")
else:
  nums = [i for i in range(1,N+1)]
  primes = get_sieve_of_eratosthenes(N)
  max_prime = max(primes)
  new_nums = list(map(lambda x: x%max_prime, nums))
  print(sum(new_nums))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

N=int(input())

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

print(int(s))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

N, N_1 = N/2, (N-1)/2 
print(int(max(N + N_1, 0)))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
if N == 1:
    ans = 0

elif N == 2:
    ans = 1
else:
    # suffix = 0 if N & 1 else 1
    ans = int((N-2)/2 * (2+N-1) + 1)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = int(input())
if N == 1:
    print(0)
else:
    print(int(culc(N)))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = int(input())

if A>2:
    kotae=(2+A-1)*(A-2)/2
    kotae=kotae+1
    kotae=int(kotae)
if A==2:
    kotae=1
if A==1:
    kotae=0
print(kotae)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
# import random
# import bisect
# import math
# import numpy as np
# from fractions import gcd
# import itertools

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def make_divisors(n):
    # divisors = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            # divisors.append(i)
            return i
            # if i != n // i:
            #     divisors.append(n//i)


def n_to_10(X, n):
    if int(X / n):
        return n_to_10(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    ip = IP()
    id = Idea()
    """この下から書いてね"""
    n = int(input())
    if n == 1:
        print(1)
    else:
        memo = ((n-1)/2 * n)
        print(int(id.ceil(memo, 1)))


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

if n == 0:
    print(0)
    exit()
if n == 1:
    print(1)
    exit()
print(int(n*(n+1)/2))

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N = INT()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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:
N = int(input())

ans = (1+N-1)*(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:
N = int(input())
N = N-1
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:
# coding: utf-8
import sys
# import random
# import bisect
# import math
# import numpy as np
# from fractions import gcd
# import itertools

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def make_divisors(n):
    # divisors = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            # divisors.append(i)
            return i
            # if i != n // i:
            #     divisors.append(n//i)


def n_to_10(X, n):
    if int(X / n):
        return n_to_10(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    ip = IP()
    id = Idea()
    """この下から書いてね"""
    n = int(input())
    memo = ((n-1)/2 * n)
    print(int(id.ceil(memo, 1)))


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import random

n = int(input())
nums = random.sample([i for i in range(1,n+1)], n)
p = 0
for i,j in zip(nums,range(1,n+1)):
    p += j%i
print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    ans = 0
if n == 2:
    ans = 1
if n > 2:
    ans = n//2 + ((n+1)*(n-2))//2
    ans = ((n+1)*(n-2))//2 + n%2

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

Submission status: Wrong Answer

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


def solve(N: int):
    print(int(0.5 * N * (N-1)))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

M = 0

M = (1 + N) * N / 2

M = M - N

print(int(M))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
# import random
# import bisect
# import math
# import numpy as np
# from fractions import gcd
# import itertools

"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def make_divisors(n):
    # divisors = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            # divisors.append(i)
            return i
            # if i != n // i:
            #     divisors.append(n//i)


def n_to_10(X, n):
    if int(X / n):
        return n_to_10(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    ip = IP()
    id = Idea()
    """この下から書いてね"""
    n = int(input())
    memo = ((n + 1)/2 * n - n)
    print(int(id.ceil(memo, 1)))


main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
if n==1:
    print(0)
    exit()
else:
    ans = (n-1) * n * 0.5
    print(int(ans))

Submission status: Wrong Answer

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