Harryxun/stf_run huggingface dataset:
def suicide(lis):
    if len(lis) == 1:
        print lis[0]
    pokakito = []
    for i in range(len(lis)-1):
        check = lis[i] + lis[i+1]
        one = int(str(check)[-1])
        pokakito.append(one)
    else:
        suicide(pokakito)

while True:
    try:
        lis = [int(char) for char in raw_input()]
        suicide(lis)
    except EOFError:
        break

### FIXED CODE ###

def suicide(lis):
    if len(lis) == 1:
        print lis[0]
        return
    pokakito = []
    for i in range(len(lis)-1):
        check = lis[i] + lis[i+1]
        one = int(str(check)[-1])
        pokakito.append(one)
    else:
        suicide(pokakito)

while True:
    try:
        lis = [int(char) for char in raw_input()]
        suicide(lis)
    except EOFError:
        break
def main():
  S_=input()
  T=input()
  U=[]
  if len(S_)<len(T):
    print('UNRESTORABLE')
    return
  for i in range(len(S_)-len(T)+1):
    flag=True
    for j in range(len(T)):
      if S_[i+j]!='?' and S_[i+j]!=T[j]:
        flag=False
        break
    if flag:
      S=['a']*len(S_)
      for k in range(i):
        if S_[k]!='?':
          S[k]=S_[k]
      for k in range(i,i+len(T)):
        S[k]=T[k-i]
      for k in range(i+len(T),len(S_)):
        if S[k]_!='?':
          S[k]=S_[k]
      if ans=='':
        ans=''.join(S)
      elif ans>''.join(S):
        ans=''.join(S)
  if ans=='':
    print('UNRESTORABLE')
  else:
    print(ans)
  return

main()


### FIXED CODE ###


def main():
  S_=input()
  T=input()
  ans=''
  if len(S_)<len(T):
    print('UNRESTORABLE')
    return
  for i in range(len(S_)-len(T)+1):
    flag=True
    for j in range(len(T)):
      if S_[i+j]!='?' and S_[i+j]!=T[j]:
        flag=False
        break
    if flag:
      S=['a']*len(S_)
      for k in range(i):
        if S_[k]!='?':
          S[k]=S_[k]
      for k in range(i,i+len(T)):
        S[k]=T[k-i]
      for k in range(i+len(T),len(S_)):
        if S_[k]!='?':
          S[k]=S_[k]
      if ans=='':
        ans=''.join(S)
      elif ans>''.join(S):
        ans=''.join(S)
  if ans=='':
    print('UNRESTORABLE')
  else:
    print(ans)
  return

main()
N=int(input())
a=list(map(int,input().split()))
a=[a[i]-a[0] for i in a]
cnt=0
for i in range(len(a)):
    if a[i]>=0:
        cnt+=1
    a=[a[j]-a[i] for j in a]
print(cnt)

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(N):
    if max(a[:i+1])==a[i]:
    	cnt+=1
print(cnt)
n = int(input())
a = list(map(int, input().split()))


import sys
if n == 2:
    print(max(a))
    sys.exit()


def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


g = a[0]
gcd_left = [g]
for i in range(n-1):
    g = gcd(g, a[i+1])
    gcd_left.append(g)

g = a[n-1]
gcd_right = [g]
for i in range(n-1):
    g = gcd(g, a[n-2-i])
    gcd_right.append(g)

max_gcd = gcd_right[n-1]
for i in range(1, n-1):
    max_gcd = max(max_gcd, gcd(gcd_left(i-1), gcd_right(n - 2 - i)))
max_gcd = max(max_gcd, gcd_left[n-1])

print(max_gcd)

### FIXED CODE ###


n = int(input())

a = list(map(int, input().split()))
a.sort(reverse=True)


from functools import lru_cache
import sys
if n == 2:
    print(max(a))
    sys.exit()


@lru_cache(maxsize=100000)
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


def gcd_list(li):
    if len(li) == 1:
        return li[0]
    g = gcd(li[0], li[1])
    for i in range(2, len(li)):
        g = gcd(g, li[i])
    return g


def gcd_list_2(li):
    g = gcd(li[0], li[1])
    if g == 1:
        return max(gcd_list([li[0]] + li[2:]), gcd_list(li[1:]))
    for i in range(2, n):
        if gcd(g, li[i]) == 1:
            if i == n - 1:
                return gcd_list(li[:i])
            gg = gcd_list(li[i+1:])
            bb = [gcd(li[x], gg) for x in range(i+1)]
            bb.sort()
            return bb[1]
        else:
            g = gcd(g, li[i])
    return g


def max_gcd(a):
    g = gcd_list(a)
    a = [a[i]//g for i in range(n)]
    m = gcd_list_2(a)
    print(g * m)


max_gcd(a)
import sys
from io import StringIO
import unittest
from itertools import combinations

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


    a=list(range(0, 100))
    t=0
    xx = combinations(a, 3)

    if k==3:
    for p in xx:
        if n<(10**p[0]+10**p[1]+10**p[2]):
            continue
        elif n>=(10**p[0]*9+10**p[1]*9+10**p[2]*9):
            t+=9*9*9
        else:
            for i in range(1,10):
                for j in range(1,10):
                    for k in range(1,10):
                        if n>=(10**p[0]*i+10**p[1]*j+10**p[2]*k):
                             t+=1
    else k==2:
        if n<(10**p[0]+10**p[1]):
            continue
        elif n>=(10**p[0]*9+10**p[1]*9):
            t+=9*9*9
        else:
            for i in range(1,10):
                for j in range(1,10):
                        if n>=(10**p[0]*i+10**p[1]*j):
                             t+=1
    else k==1:
        if n<(10**p[0]):
            continue
        elif n>=(10**p[0]*9):
            t+=9*9*9
        else:
            for i in range(1,10):
                for j in range(1,10):
                        if n>=(10**p[0]*i):
                             t+=1


    print(t)

    return

resolve()

### FIXED CODE ###

import sys
from io import StringIO

def resolve():
    s=input().strip()
    k=int(input().strip())

    dp = [[[0 for a in range(2)] for b in range(5)]for c in range(105)]

    #0 same 1 under
    dp[0][0][0]=1

    keta=1
    for a in s:
        for b in range(4):
            for c in range(2): #0 same 1 under
                n=int(a)
                for d in range(10):
                    if c==0 and d > n:
                        #out
                        continue

                    b2 = b
                    if d != 0:
                        b2 += 1
                    
                    c2=c
                    if c==0 and n != d:
                        c2 = 1

                    dp[keta][b2][c2]+=dp[keta-1][b][c]
        keta+=1

    ans = dp[len(s)][k][0] + dp[len(s)][k][1]

    print(ans)

    return

resolve()
a=input()
print(a**2)


### FIXED CODE ###


a=int(input())
print(a**2)
n = int(input())
s = input()
slimes = s.split("")
i = 0
while i < n - 1:
  s = slimes[i]
  while s == slimes[i + 1]:
    del slimes[i + 1]
    n -= 1
  i += 1
print n

### FIXED CODE ###

n = int(input())
s = input()

ans = 1
current = s[0]
for i in range(n):
  if current != s[i]:
    ans += 1 
    current = s[i]
print(str(ans))
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)

    if temp!=1:
        arr.append(1)

    if arr==[]:
        arr.append(1)

    return arr

n = int(input())
ln = factorization(n)
ans = 0
for i in range(1, max(ln) + 1):
    for j in range(len(ln)):
        if ln[j] < i:
            ln.pop(j)
    ans += len(ln)
    ln = list(map(lambda x: x - i, ln))
    if ln == [] or sum(ln)==0:
        break
print(ans)

### FIXED CODE ###

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)

    if temp!=1:
        arr.append(1)

    if arr==[]:
        arr.append(1)

    return arr

n = int(input())
ln = factorization(n)
ans = 0
for i in range(1, max(ln) + 1):

    ln = [x for x in ln if x >= i]
    ans += len(ln)
    ln = list(map(lambda x: x - i, ln))
    if sum(ln)==0:
        break
import sys

if n == 1:
    print(0)
    sys.exit()
print(ans)
import math
n,d = map(int,input().split())
r = 0
for in range(n):
  a,b = map(int,input().split())
  if d >= math.sqrt(a**2 + b**2)
  	r += 1
print(r)

### FIXED CODE ###

import math
n,d = map(int,input().split())
r = 0
d_ = d**2
for i in range(n):
  a,b = map(int,input().split())
  if d_ >= a**2 + b**2:
    r += 1
print(r)
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N_with_K = list(map(int, input().split()))
N = N_with_K[0]
K = N_with_K[1]

for_mod = 10**9 + 7
for i in range(K+1):
  if i == 0:
    pass
  else:
    post_pattern = cmb(N-K+1, i)
    num_pattern =  cmb(K-1, i-1)
    all_pattern = post_pattern * num_pattern
    print(all_pattern % for_mod)

### FIXED CODE ###

from operator import mul
from functools import reduce

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 
N = 10**4
g1 = [1, 1]
g2 = [1, 1] 
inverse = [0, 1] 

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


N_with_K = list(map(int, input().split()))
N = N_with_K[0]
K = N_with_K[1]


for i in range(K+1):
  if i == 0:
    pass
  else:
    post_pattern = cmb(N-K+1, i, mod)
    num_pattern =  cmb(K-1, i-1, mod)
    all_pattern = post_pattern * num_pattern
    print(all_pattern % mod)
S = list(input())
s = set(S)

if len(s) == len(S):
    print('yes')
else:
    prirnt('no')

### FIXED CODE ###

S = list(input())
s = set(S)

if len(s) == len(S):
    print('yes')
else:
    print('no')
h = 0
w = 0
list1 = []

def dfs(x, y, f):
    list1[y] = list1[y][:x] + '1' + list1[y][x+1:]

    if y - 1 >= 0:
        if list1[y - 1][x] == f:
            dfs(x, y - 1, f)
    if y + 1 < h:
        if list1[y + 1][x] == f:
            dfs(x, y + 1, f)
    if x - 1 >= 0:
        if list1[y][x - 1] == f:
            dfs(x - 1, y, f)
    if x + 1 < w:
        if list1[y][x + 1] == f:
            dfs(x + 1, y, f)
    return

while True:
    h, w = list(map(lambda x: int(x),input().split(" ")))
    if 0 in (h, w):
        break
    n = 0
    for i in range(0, h):
        list1.append(input())
    for i in range(0, h):
        for j in range(0, w):
            if list1[i][j] != '1':
                dfs(j, i, list1[i][j])
                n+=1
    print(n)
    list1=[]

### FIXED CODE ###

h = w = 0
slist =[]
list1=[]
def dfs(f):
    while True:
        if len(slist) == 0:
            return 1
        coordinate= slist.pop()
        #print(coordinate)
        x = coordinate[0]
        y = coordinate[1]

        list1[y] = list1[y][:x] + '1' + list1[y][x + 1:]
        if x + 1 < w:
            if list1[y][x + 1] == f:
                slist.append([x + 1,y])
        if x - 1 >= 0:
            if list1[y][x-1] == f:
                slist.append([x - 1, y])
        if y + 1 < h:
            if list1[y + 1][x] == f:
                slist.append([x, y + 1])
        if y -1 >= 0:
            if list1[y -1][x] == f:
                slist.append([x, y - 1])

while True:
    h, w = list(map(lambda x: int(x),input().split(" ")))
    if 0 in (h, w):
        break
    n = 0
    for i in range(0, h):
        list1.append(input())
    for i in range(0, h):
        for j in range(0, w):
            if list1[i][j] != '1':
                slist.append([j,i])
                n += dfs(list1[i][j])
            #print(list1)
    print(n)
    list1=[]
N, K = map(int,input().split())
H = [int(i) for i in input().split()]
ans = sum(1 for x in H if x >= K)
print(ans)

### FIXED CODE ###

N=int(input())
print((N//2+N%2)/N)
n, k = [int(x) for x in input().split(' ')]

def abs_diff(n, k):
  first_time = abs(n - k)
  second_time = abs(first_time - k)
  if second_time <= first_time:
    abs_diff(first_time, k)
  elif first_time <= n:
    print(first_time)
  else:
    print(n)

abs_diff(n, k)

### FIXED CODE ###

n, k = list(map(int, input().split()))
 
print(min(n % k, abs(k - n % k)))
import numpy as np

def read_input():
    n = int(input())
    alist = list(map(int, input().split()))

    return n, alist


def split_a(n, alist):
    curr = 0
    for i in range(n):
        ar1 = alist[:i]
        ar2 = alist[i+1:]

        temp = mygcd(ar1, ar2)
        if curr < temp:
            curr = temp

    print(curr)


def mygcd(ar1, ar2):
    if not ar1:
        return np.gcd.reduce(ar2)

    if not ar2:
        return np.gcd.reduce(ar1)

    return np.gcd.reduce(ar1 + ar2)

if __name__ == '__main__':
    n, alist = read_input()
    split_a(n, alist)

### FIXED CODE ###



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)
    

def gcd_all(lst):
    g = gcd(lst[0], lst[1])
    for e in lst[2:]:
        g = gcd(g, e)
    return g


def submit():
    n = int(input())
    alist = list(map(int, input().split()))

    if n == 2:
        print(max(alist))
    else:
        # 左から計算したgcd列
        gcd_left = [alist[0]]
        for a in alist[1:]:
            gcd_left.append(gcd(gcd_left[-1], a))
        
        # 右から計算したgcd列
        gcd_right = [alist[-1]]
        for a in reversed(alist[:-1]):
            gcd_right.append(gcd(gcd_right[-1], a))
        gcd_right = gcd_right[::-1]

        gcd_max = 0
        for i in range(n):
            if i == 0:
                gcd_i = gcd_right[i + 1]
            elif i == n - 1:
                gcd_i = gcd_left[i - 1]
            else:
                gcd_i = gcd(gcd_left[i - 1], gcd_right[i + 1])

            if gcd_max < gcd_i:
                gcd_max = gcd_i

        print(gcd_max)


if __name__ == "__main__":
    submit()
x=input()
if x>=30 :
  put('Yes') 
else :  
  put('No')

### FIXED CODE ###

x=int(input())
if x>=30:
  print('Yes')   
else:
  print('No')
MOD = 10**9 + 7
n, k = map(int, input().split())
a = list(map(int, input().split()))
plus,minus=[],[]
for i in a:
    if i<0:
        minus.append(i)
    else:
        plus.append(i)
plus.sort(reverse = True)
minus.sort()
plus.append(-10**10)
plus.append(10**10)
minus.append(10**10)
minus.append(-10**10)
ans = 1
if n == k:
    for i in range(n):
        ans *= a[i]
        ans %= MOD
    print(ans)
elif len(plus) == 2 and k % 2 == 1:
    for i in range(3, k + 3):
        ans *= minus[-i]
        ans %= MOD
    print(ans)
else:
    cplus = 0
    cminus = 0
    p = k // 2
    if k % 2 == 1:
        ans *= plus[0]
        cplus = 1
    else:
        for _ in range(p):
            if plus[cplus] * plus[cplus + 1] > minus[cminus] * minus[cminus + 1]:
                ans *= plus[cplus] * plus[cplus + 1]
                ans %= MOD
                cplus += 2
            else:
                ans *= minus[cminus] * minus[cminus + 1]
                ans %= MOD
                cminus += 2
    print(ans)

### FIXED CODE ###

n = int(input())
print(-n % 1000)
n,A,B=map(int,input().split())
if A+2>=B:
  ans=bis+n
else:

  print("A n",A,n)
  if (n+1)>=(A+2):
    en+=(n+1)//(A+2)
    n-=en*(A+2)-1
    print(bis,en,n)
    #交換
    bis=en*B
    en=0
    print("交換",bis,en,n)
  if n==0:
    ans=bis
  else:
    ans=bis+n
  
print(ans)

### FIXED CODE ###

b,c=map(int,input().split())
  
if (b//2+b%2)>=c:
    print("YES")
else : print("NO")
a, b, c = [int(input()) for _ in range(3)]
ans = b+c-a
if ans < 1:
    print(0)
else:
    print(ans)


### FIXED CODE ###

a, b, c = map(int, input().split())
ans = b+c-a
if ans < 1:
    print(int(0))
else:
    print(ans)
import sys
sys.setrecursionlimit(10**8)
N=int(input())
abc=list("abcdefghi")
def dfs(s,v):
    global N
    for i in range(v+2):
        ns=s+abc[i]
        if len(ns)<N :
            if i!=v+1:
                dfs(ns,v)
            else:
                dfs(ns,v+1)
        if len(ns)==N:
            print("".join(ns))
if N==1:
    print("a")
else:
    dfs("a",0)

### FIXED CODE ###

#=============================================================================
# パナソニックコンテスト D
#=============================================================================
import sys
sys.setrecursionlimit(10**8)
N=int(input())
abc=list("abcdefghij")
def dfs(s,v):
    global N
    for i in range(v+2):
        ns=s+abc[i]
        if len(ns)<N :
            if i!=v+1:
                dfs(ns,v)
            else:
                dfs(ns,v+1)
        if len(ns)==N:
            print("".join(ns))
if N==1:
    print("a")
else:
    dfs("a",0)
# -*- coding: utf-8 -*-
X = int(input())
T = int(input())
N = int(input())
Y = X
ans = 0
cnt = 1

while X < N:
    X = X + Y
    cnt = cnt + 1

ans = T * cnt
print(ans)


### FIXED CODE ###

n, x, t = map(int, input().split())
tm = (n // x) * t 
if (n % x) != 0:
    tm += t
print(tm)
import math

A,B = map(int, input().split())

print(math.floor(A*B))


### FIXED CODE ###

import sys
S, T = map(str, input().split())
 
S1 = int(S)
T1 = T.replace(".", "")


print(S1*int(T1)//100)
n = int(input())
a,b,c = input(),input(),input()

ans = 0
for i in range(n):
  cnt = len(set(a[i],b[i],c[i]))-1
  ans += cnt

print(ans)


### FIXED CODE ###


n = int(input())
a = input()
b = input()
c = input()

ans = 0
for i in range(n):
    cnt = 2
    if a[i]==b[i]: cnt -= 1
    if b[i]==c[i]: cnt -= 1
    if c[i]==a[i]: cnt -= 1
    if cnt<0: cnt = 0
    ans += cnt

print(ans)
n, m, l = map(int, input().split())
A = []
B = []
C = [[0] * l for i in range(n)]
for x in range(n):
	for y in range(m):
		A[x].append(list(map(int, input().split())))

for x in range(m):
	for y in range(l):
		B[x].append(list(map(int, input().split())))

for x in range(n):
	for y in range(l):
		sum = 0
		for z in range(m):
			sum += A[x][z] * B[z][y]
		C[x][y] = sum

for x in range(n):
	for y in range(l-1):
		print("{0} ".format(C[x][y], end = '')
	print(C[x][y+1])

		

### FIXED CODE ###

n, m, l = map(int, input().split())
A = []
B = []
C = [[0] * l for i in range(n)]
for x in range(n):
	A.append(list(map(int, input().split())))

for x in range(m):
	B.append(list(map(int, input().split())))

for x in range(n):
	for y in range(l):
		sum = 0
		for z in range(m):
			sum += A[x][z] * B[z][y]
		C[x][y] = sum

for x in range(n):
	for y in range(l-1):
		print("{0} ".format(C[x][y]), end = '')
	print(C[x][l-1])
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


n, m = map(int, input().split())
sc = [input().split() for i in range(m)]
# print(sc)
# print(len(sc))
if len(sc) == 1:
    print(-1)
    exit()

for i in range(m):
    if (sc[0][0] == sc[i][0])and(sc[0][1] != sc[i][1]):
        print(-1)
        exit()

#print(sorted(set(list(map(tuple, sc)))))
x = sorted(set(list(map(tuple, sc))))
# print(len(x))
# print(x[0][0])
for i in range(len(x)):
    if int(x[i][0]) == 1:
        h = 100*int(x[i][1])
        # print(h)
    elif int(x[i][0]) == 2:
        i = 10*int(x[i][1])
        # print(i)
    elif int(x[i][0]) == 3:
        j = 1*int(x[i][1])
        # print(j)
print(h+i+j)


### FIXED CODE ###

import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


N, M = map(int, input().split())
cs = [None]*N
for i in range(M):
    s, c = map(int, input().split())
    #print(s, c)
    if cs[(s-1)] == None:
        cs[(s-1)] = c
    elif cs[s-1] != c:
        print(-1)
        exit()


def check(x):
    s = str(x)
    if not(len(s) == N):
        return False
    for i in range(N):
        if not(cs[i] == None or cs[i] == int(s[i])):
            return False
    return True


for i in range(10000):
    if check(i):
        print(i)
        exit()
print(-1)
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000.0
while True:
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    v=sorted(v)
    n=len(v)
    if n==1:
        print(v[0])
        break

### FIXED CODE ###

n=int(input())
v=sorted(list(map(float,input().split())))
z = v[0]
for i in range(1,n):
    z=(z+v[i])/2
print(z)
money,sum=int(input().split())
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

money,sum=map(int,input().split())
money500=500*money
if money500>=sum:
    print('Yes')
else:
    print('No')
from sys import exit
import queue
V,E = [int(n) for n in input().split()]
ans = []

# N = int(input())
graph = [[] for _ in range(E)]
indeg = [0]*E
yet = [True]*E
def bfs(s):
    q = queue.Queue()
    q.put(s)
    while(not q.empty()):
        u = q.get()
        ans.append(u)
        yet[u]=False
        for v in graph[u]:
            indeg[v]-=1
            if(indeg[v]==0):
                q.put(v)

for i in range(E):
    s, t = [int(n) for n in input().split()]
    graph[s].append(t)
    indeg[t]+=1
for i in range(E):
    if(indeg[i]==0 and yet[i]):
        bfs(i)
for a in ans:
    print(a)
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()



### FIXED CODE ###

from sys import exit
import queue
V,E = [int(n) for n in input().split()]
ans = []

# N = int(input())
graph = [[] for _ in range(V)]
indeg = [0]*V
yet = [True]*V
def bfs(s):
    q = queue.Queue()
    q.put(s)
    while(not q.empty()):
        u = q.get()
        ans.append(u)
        yet[u]=False
        for v in graph[u]:
            indeg[v]-=1
            if(indeg[v]==0):
                q.put(v)

for i in range(E):
    s, t = [int(n) for n in input().split()]
    graph[s].append(t)
    indeg[t]+=1
for i in range(V):
    if(indeg[i]==0 and yet[i]):
        bfs(i)
for a in ans:
    print(a)
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()
from scipy.special import comb
n,m = map(int, input().split())

all = comb(n+m,2,exact=True)

print(all-m*n)

### FIXED CODE ###

n,m = map(int, input().split())
all = (n+m)*(n+m-1)/2
print(int(all-m*n))
import math
def isprime(n):
    m = int(math.sqrt(n)) + 1
    check = 1
    nums = [i for i in range(2, n)]
    while nums[0] <= m:
        p = nums[0]
        for j in range(1, int(n / p) + 1):
            nums.remove(p * j)
        if n not in nums:
            check = 0
            break
        else:
            pass
    return check
    
n = int(input())
ans = 0
for k in range(n):
    a = int(input())
    ans += isprime(a)
    
print(ans)


### FIXED CODE ###

def isprime(n):
    check = 1
    if n == 2:
        pass
    elif n == 1 or n % 2 == 0:
        check = 0
    else:
        i = 3
        while i * i <= n:
            if n % i == 0:
                check = 0
                break
            else:
                i += 2
    return check
        

n = int(input())
ans = 0
for k in range(n):
    a = int(input())
    ans += isprime(a)
    
print(ans)
import sys

def diff(N,A,B,C,D):
    mini = (B+(N-1)*D-A)/(C+D)
    for i in xrange(mini, N-1):
        lower_bound = A + i*C - (N-i-1)*D
        upper_bound = A + i*D - (N-i-1)*C
        print(lower_bound, upper_bound)
        if lower_bound <= B and B <= upper_bound:
            return True
        elif B < lower_bound:
            return False

str = sys.stdin.readline().strip() #"491995 412925347 825318103 59999126 59999339"
N,A,B,C,D = map(int,str.strip().split(" "))
print("YES" if diff(N,A,B,C,D) else "NO")


### FIXED CODE ###

import sys

def diff(N,A,B,C,D):
    mini = (B+(N-1)*D-A)/(C+D)
    for i in range(int(mini), N-1):
        lower_bound = A + i*C - (N-i-1)*D
        upper_bound = A + i*D - (N-i-1)*C
        #print(lower_bound, upper_bound)
        if lower_bound <= B and B <= upper_bound:
            return True
        elif B < lower_bound:
            return False

str = sys.stdin.readline().strip() #"491995 412925347 825318103 59999126 59999339"
N,A,B,C,D = map(int,str.strip().split(" "))
print("YES" if diff(N,A,B,C,D) else "NO")
n = int(input())
a = sorted(list(map(int, input().split())))
s = 1
if o in a:
    print(0)
    exit()
for i in range(n):
  s *= a[i]
  if s>10**18:
      print(-1)
      exit()
print(s)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = 1
if 0 in a:
    print(0)
    exit()
for i in range(n):
  s *= a[i]
  if s>10**18:
      print(-1)
      exit()
print(s)