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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
r = int(input())
if (r-1) % 2 == 0:
    print(int((1 + (r-1)) * (r-1) / 2))
else:
    print(int((1 + (r-1)) * (r-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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve(inp):
    N = int(inp.readline().strip())

    r = (N * (N - 1)) / 2
    return int(r)


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(str(result))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def solve(inp):
    N = int(inp.readline().strip())

    r = (N * (N - 1)) / 2
    return int(r)


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def solve(inp):
    N = int(inp.readline().strip())

    r = (N * (N - 1)) / 2
    return int(r)


def main():
    import sys
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def solve(inp):
    N = int(inp.readline().strip())

    r = 0
    for i in range(N - 1):
        r += (i + 1)

    return r


def main():
    import sys
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())

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

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())
l = list()
for i in range(n):
    l.append(i)
print(len(l)-1)

Submission status: Wrong Answer

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


main()

Submission status: Wrong Answer

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


main()

Submission status: Wrong Answer

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


main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in range(n-1,1,-1):
    ans+=i
ans+=1
print(ans)

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    '''
    N = aq + r (0 <= r <= a-1)よりΣrを最大にするのはr = a-1のとき 
    '''
    N = int(input())
    N -= 1
    print(N * N // 2)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(ans)

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

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

if N == 1:
    print(0)

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)

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

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
if N >1:
    sum = N*(N-1)/2
else:
    sum = 0
sum = int(sum)
print(sum)

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
if N >1:
    sum = N*(N-1)/2
elif N == 1:
    sum = 1
else:
    sum = 0
sum = int(sum)
print(sum)

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
sum = N*(N-1)/2
sum = int(sum)
print(sum)

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
sum = int((N)*(N-1)/2)
print(sum)

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
sum = (N)*(N-1)/2
print(sum)

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
print((N-2)*(N-1)/2)

Submission status: Wrong Answer

Solution code:
#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
print(N*(N-1)/2)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input().strip())
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*(n-1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
a=N*(N-1)
print(int(a/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 input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
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
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def MAP(): return [int(s) for s in input().split()]

n = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def MAP(): return [int(s) for s in input().split()]

n = int(input())
if n==1:
	print(0)
	sys.exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

MOD = 10**9+7

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

Submission status: Wrong Answer

Solution code:
import math
def calculate(n):
    return math.floor(n * (n-1) / 2)

N = int(input())
print(calculate(N))

Submission status: Wrong Answer

Solution code:
import math

def calculate(n):
    return n * (n-1) / 2

print(int(calculate(13)))

Submission status: Wrong Answer

Solution code:
def calculate(n):
    if n <= 0:
        return 0
    return ((n-1) * n) / 2

N = int(input())
print(int(calculate(N)))

Submission status: Wrong Answer

Solution code:
def calculate(n):
    if n <= 0:
        return 0;
    return int(n*(n-1) / 2)

N = int(input())
print(calculate(N))

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

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

N = int(input()) # String

N = np.uint64(N)

if N == 0:
    print(0)
else:
    if N % 2 == 0:
        print(np.uint64(N / 2 * (N - 1)))
    else:
        print(np.uint64(((N - 1) / 2) * N))

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

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

N = int(input()) # String

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

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

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

N = int(input()) # String

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

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

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

N = int(input()) # String

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())
a, b = n, n-1
if a%2==0:
  a /= 2
else:
  b /= 2
print("%d"%(a*b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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)/2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(int(sum))

Submission status: Wrong Answer

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

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

print(sum)

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

array =[[0 for i in range(N)] for j in range(N)];

# 割った余りを格納
for i in range(N) :
   for j in range(N):
    array[i][j] = (i+1) % (j+1);

maxVal =0;

# 割った余りから最大値を算出
for i in range(N) :
    maxVal += max(array[i]);

print(maxVal);

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

wa = 0
a = n+1
wa = (n+1)*(n//2)
if n % 2 == 1:
    wa+=(n+1)/2

print(int(wa-n))

Submission status: Wrong Answer

Solution code:
n=int(input())


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

print(k)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
n_array = [m + 1 for m in range(n)]
max_n =[]
max_tmp = []
for i in range(n):
    for m in range(n):
        max_tmp.append((i + 1) % n_array[m])
    max_n.append(max(max_tmp))
print(sum(max_n))

Submission status: Wrong Answer

Solution code:
import random
n = int(input())
n_array = [m + 1 for m in range(n)]
random.shuffle(n_array)
m = []
for i in range(n):
    tmp = (i + 1) % n_array[i]
    m.append(tmp)
print(sum(m))

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect

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


def main():
	N = INT()
	A = [LIST() for _ in range(N)]

	ans = 0
	sum_ = 0
	while 1:
		delete = [0]*(N+1)
		for i in range(1, N):
			if len(A[i-1]) == 0:
				continue
			if i == A[A[i-1][0]-1][0]:
				delete[i] = 1
				delete[A[i-1][0]] = 1
		if sum(delete) == 0:
			print(-1)
			sys.exit(0)

		for i in range(1, len(delete)):
			if delete[i] == 1:
				sum_ += A[i-1].pop(0)
		ans += 1
		if sum_ == N*(N-1)*(N+1)//2:
			break
		
	print(ans)

if __name__ == "__main__":
	main()

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 permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left 

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

def main():
    n = INT()

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

if  __name__=='__main__':
    main()

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

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

Submission status: Wrong Answer

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

f = n*(n-1)/2

print(int(f))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import copy

N = int(input())

A = []

for i in range(0, N):
    A.append(i)
    
B = copy.deepcopy(A)
del B[0:1]

B = copy.deepcopy(A)
del B[0:1]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(map(int, input().split()))

import numpy as np

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = int(input())

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

Submission status: Wrong Answer

Solution code:
#ABC139 D - ModSum

N = int(input())

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

Submission status: Wrong Answer

Solution code:

N = int(input())

#一つずらしが余りの最大になりそう
#答えは1からN-1までを足した数

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
# import math
# import numpy as np
# from functools import lru_cache

args = sys.argv
if len(args) == 2:
  from IPython import embed
  em = True
else:
  em = False

# sys.setrecursionlimit(10000)

#### input
N = int(input())
# a, b = map(int, input().split())
# a = list(map(int, input().split()))
# a = list(map(lambda x: int(x)*(-1), a))  # 各要素を-1倍


# n = int(input())
# t = [int(input()) for i in range(n)]
if em: sys.stdin = open('/dev/tty')

#### function
# @lru_cache(maxsize=10000)

#### process

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

# I = [i for i in range(1, N+1)]
# P = [i for i in range(2, N+1)]
# P.append(1)

# rems = [I[i] % P[i] for i in range(0, len(I))]
# print(sum(rems))

# if em: embed()

## heapsort, O(NlogN)
# import heapq
# heapq.heapify(A)
# min = heapq.heappop(A)
# heapq.heappush(A, new_element)

Submission status: Wrong Answer

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

if N>2:
    ans=0

    add = int((N-1)*N/2)
    print(ans+add)
elif N==2:
    print("1")
elif N==1:
    print("0")

Submission status: Wrong Answer

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

if N>2:
    print(int((N+1)*N/2 -N))
elif N==2:
    print("1")
elif N==1:
    print("0")

Submission status: Wrong Answer

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

if N>2:
    ans=0

    add = int((N+1)*N/2 -N)
    print(ans+add)
elif N==2:
    print("1")
elif N==1:
    print("0")

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

N = int(stdin.readline())
sum = 0

sum = 0.5 * (N) *(N-1)

print(int(sum))

Submission status: Wrong Answer

Solution code:
N = int(input())

N -= 1

print('%d' % (N * (N + 1) / 2))

Submission status: Wrong Answer

Solution code:
N = int(input())

N -= 1

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Oct  4 08:17:59 2019

@author: avina
"""

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

Submission status: Wrong Answer

Solution code:
# 1%P1 + 2%P2 + 3%P3 + ... + N%PN の最大値
# 1~N-1までの総和を超える値xがあるとする
# N*(N-1)/2 < x < N*(N+1)/2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
a = np.array(range(1,n+1))
b = np.array([a[(i+1)%n] for i in range(n)])
sum(a%b)

Submission status: Wrong Answer

Solution code:
import math

n = float(input())
print(math.floor((n-1)*n//2))

Submission status: Wrong Answer

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