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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
  print(1)
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())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
# ABC139
# D
# ModSum

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

Submission status: Wrong Answer

Solution code:
from math import floor
N = int(input())
if N == 2:
    ans = 1
elif N%2 == 0:
    ans = (1+N-1)*((N-1)//2) + floor((N-1)/2)
else:
    ans = (1+N-1)*((N-1)//2)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import floor
N = int(input())
if N%2 == 0:
    ans = (1+N-1*((N-1)//2)) + floor((N-1)/2)
else:
    ans = (1+N-1)*((N-1)//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(int(N*(N+1)/2-N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[21]:


P = int(input())


# In[22]:


# i_list = list(range(1, P+1))
# p_list = i_list[1:]
# p_list.append(i_list[0])

# # print(i_list, p_list)

# ans = 0
# for i in range(P):
#     ans += i_list[i]%p_list[i]
# print(ans)

# ans = sum(range(1,P))
ans = int(P*(P-1)/2)
print(ans)


# In[ ]:

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[8]:


P = int(input())


# In[12]:


# i_list = list(range(1, P+1))
# p_list = i_list[1:]
# p_list.append(i_list[0])

# # print(i_list, p_list)

# ans = 0
# for i in range(P):
#     ans += i_list[i]%p_list[i]
# print(ans)

ans = sum(range(1,P+1))
print(range(1,P+1), ans)


# In[ ]:

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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)

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print("0")
else:
    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())
ans = 0
for i in range(n):
    ans += i
    ans = ans % (10**9 + 7)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
#from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

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

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

print(_sum - n)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

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

print(_sum - n)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

_sum = n / 2 * (n + 1)

print(int(_sum - n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

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

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Wrong Answer

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

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

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest

def resolve():
    n = int(input())

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

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """2"""
        output = """1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """13"""
        output = """78"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1"""
        output = """0"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest

def resolve():
    n = int(input())

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

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """2"""
        output = """1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """13"""
        output = """78"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1"""
        output = """0"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
import fractions
import heapq

n = int(stdin.readline().rstrip())

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

print(cnt)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
import fractions
import heapq

n = int(stdin.readline().rstrip())

cnt = int((1 + (n-1)) * (n-1) / 2)

print(cnt)

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

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

print(int(result))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
import math

def main(n):
    return int(n * (n-1) / 2)

n = int(input())
print(main(n))

Submission status: Wrong Answer

Solution code:
import math

def main(n):
    return int((n * (n+1) / 2) - n)

n = int(input())
print(main(n))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)
elif N == 2:
    print(0)
else:
    print((N-1)*(N-2)//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())
print((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:
# AtCoder
N = int(input())
ans = N*(N-1)/2
print(int(ans))

Submission status: Wrong Answer

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


if __name__ == '__main__':
    q4()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

n = int(input())
print(round(n*(n-1)*0.5))

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

n = int(input())
print(floor(n*(n-1)*0.5))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
n=int(input())
print(int(0.5*(n-1)*n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = 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:
#!/usr/bin/env python3
N = int(input())
print(int(N*(N-1)/2))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
N = int(input())
if N == 2:
    print(1)
    sys.exit()

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

Submission status: Wrong Answer

Solution code:
n = int(input())
# a= 4, 1, 2, 3
# b= 1, 2, 3, 4 # modのmaxは 0, 1, 2, 3 なので最大6
# ----------
#    0, 1, 2, 3 
print(int(n*(n-1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m_sum = 0
print(int(n*(n-1)/2))

Submission status: Wrong Answer

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

n=int(input())

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools

#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

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

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools

#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

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

Submission status: Wrong Answer

Solution code:
#5 0413(Youtube)
n=int(input())

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

print(ans)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
stdin=sys.stdin

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

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

Submission status: Wrong Answer

Solution code:
import sys
stdin=sys.stdin

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

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

Submission status: Wrong Answer

Solution code:
import sys
stdin=sys.stdin

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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(0.5*n*(n-1))

Submission status: Wrong Answer

Solution code:
n = int(input())
result = 0
for i in range(n):
    if i == 0:
        result += 1
    elif i == n-1:
        result += 0
    else:
        result += (i+1)%(i+2)
print(result)

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

Submission status: Wrong Answer

Solution code:
# Problem D - ModSum

# input
N = int(input())

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

# output
print(ans)

Submission status: Wrong Answer

Solution code:
# Problem D - ModSum

# input
N = int(input())

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

# output
print("%d"%(ans))

Submission status: Wrong Answer

Solution code:
# Problem D - ModSum

# input
N = int(input())

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

# output
print("%d"%(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n = int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
print("{:}".format(int((N-1)*N/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(round((N*(N-1)/2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
a=int(input())
#_l=list(map(int,input().split()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(int(ans))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import fractions
import itertools
from collections import deque
import copy
import bisect

MOD = 10 ** 9 + 7
INF = 10 ** 18 + 7
input = lambda: sys.stdin.readline().strip()

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import fractions
import itertools
from collections import deque
import copy
import bisect

MOD = 10 ** 9 + 7
INF = 10 ** 18 + 7
input = lambda: sys.stdin.readline().strip()

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): 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 LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

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


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): 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 LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

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


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

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

if __name__=='__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = input()

b = int(a)

ans = b * ((b - 1) // 2) if b != 2 else 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import random
N = 13

P = [i for i in range(1,N+1)]
M = 0
for i in range(1,N+1):
  M += max(i%P[j] for j in range(N))

print(M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

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

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

Submission status: Wrong Answer

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