Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N,K=map(int,input().split())
p=list(map(int,input().split()))
Exception_p=[]
for i in range(N):
    Exception_p.append((1+p[i])/2)
sum_Exception=[]
for i in range(N-K+1):
    sum=0
    for k in range(K):
        sum=Exception_p[i+k]+sum        
    sum_Exception.append(sum)
list.sort(sum_Exception)
print(sum_Exception.pop(-1))


### FIXED CODE ###

N,K=map(int,input().split())
p=list(map(int,input().split()))
Exception_p=[]
for i in range(N):
    Exception_p.append((1+p[i])/2)
sum_Exception=[]
sum=0
for k in range(K):
    sum=(p[k]+1)/2+sum
sum_Exception.append(sum)
for i in range(N-K):
    sum=sum_Exception[i]-p[i]/2+p[i+K]/2
    sum_Exception.append(sum)
list.sort(sum_Exception)    
print(sum_Exception.pop(-1))
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
_sum = 0

for i in range(N):
  for j in range(i+1, N):
    _sum += A[i] * A[j]

print(_sum % (10**9 + 7))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7
ak = 0
ak_2 = 0

for i in range(N):
  ak += A[i]
  ak_2 += A[i] ** 2
s = int(((ak ** 2) - ak_2) // 2)
print(s % mod)
### BUGGY CODE ###

N=int(input())
A=[]
for i in range(N):
  A.append(int(input()))
  
for i in range(N):
  tmp=A.copy()
  tmp.remove(A[i])
  print(max(tmp))

### FIXED CODE ###

N=int(input())
A=[]
for i in range(N):
  A.append(int(input()))
s=sorted(A,reverse=True)
for i in range(N):
  if A[i]!=s[0]:
    print(s[0])
  else:
    print(s[1])
### BUGGY CODE ###

n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
P = [p * (p + 1) / (2 * p) for p in P]
ans = 0
for i in range(n - k + 1):
    ans = max(ans, sum(P[i:i + k]))
print(ans)

### FIXED CODE ###

n, k = list(map(int, input().split()))
P = list(map(int, input().split()))
E = [0, ]
tot = 0
for i in range(n):
    tot += P[i] * (P[i] + 1) / (2 * P[i])
    E.append(tot)
ans = 0
for i in range(n - k + 1):
    ans = max(ans, E[i + k] - E[i])
print(ans)
### BUGGY CODE ###

N=int(input())
flag=True
inList=list(map(int,input().split()))
for i in range(len(inList)):
    for j in range(i+1,len(inList)):
        if inList[j]==inList[i]:
            print('NO')
            flag=False
            break
    if not flag:
        break

if flag:
    print('YES')

### FIXED CODE ###

from collections import Counter
N=int(input())
flag=True
inList=list(map(int,input().split()))

c=Counter(inList)
cv=list(c.values())
for i in cv:
    if i!=1:
        print('NO')
        flag=False
        break
if flag:
    print('YES')
### BUGGY CODE ###

n=int(input())
a=[int(i) for i in input().split()]
a.sort(reverse=True)
ans=0
for i in range(n):
  del a[0]
  ans+=a[0]
  del a[0]
print(ans)

### FIXED CODE ###

n=int(input())
a=[int(i) for i in input().split()]
a.sort(reverse=True)
ans=0
for i in range(n):
  ans+=a[i*2+1]
print(ans)
### BUGGY CODE ###

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

MOD = 10 ** 9 + 7


def comb(n, r):
    if n - r < r:
        r = n - r
    if r == 0:
        return 1
    if r == 1:
        return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] *= pow(pivot, MOD - 2, MOD)
                numerator[k - offset] %= MOD
                denominator[k] *= pow(pivot, MOD - 2, MOD)
                denominator[k] %= MOD

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])
            result %= MOD

    return result


# maxn = 2 * pow(10, 5)
# f = [1 for _ in range(2 * pow(10, 5) + 1)]
# invf = [1 for _ in range(2 * pow(10, 5) + 1)]

# for i in range(1, maxn + 1):
#     f[i] = (f[i - 1] * i) % MOD
# invf[maxn] = pow(f[maxn], MOD - 2, MOD)
# for i in range(maxn, -1, -1):
#     invf[i - 1] = (invf[i] * i) % MOD


# def comb(n, r):
#     return f[n] * invf[r] * invf[n - r] % MOD


res = pow(2, N, MOD)

res -= comb(N, A) + comb(N, B)
print((res - 1) % MOD)


### FIXED CODE ###

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

MOD = 10 ** 9 + 7


def comb(n, r):
    if n - r < r:
        r = n - r

    res = 1
    for i in range(n - r + 1, n + 1):
        res = res * i % MOD
    for i in range(1, r + 1):
        res = res * pow(i, MOD - 2, MOD) % MOD
    return res


res = pow(2, N, MOD)

res -= comb(N, A) + comb(N, B)
res %= MOD
print(res - 1)
### BUGGY CODE ###

n = int(input())


import math
from functools import reduce
def gcd(numbers):
  return reduce (math.gcd, numbers)


ans = 0
a = list(map(int, input().split()))
for i in range(n):
  c = a[i]
  a.remove(c)
  ans = max(ans, gcd(a))
  a.insert(i,c)
  

print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

import math
l_gcd = []
r_gcd = []

c = a[0]
for i in a[:-1]:
  c = math.gcd(c, i)
  l_gcd.append(c)
  
c = a[-1]
for j in a[1:][::-1]:
  c = math.gcd(c, j)
  r_gcd.append(c)
  
ans = max(r_gcd[-1], l_gcd[-1])
for r, l in zip(r_gcd[:-1], l_gcd[:-1][::-1]):
  c = math.gcd(r, l)
  ans = max(ans, c)
print(ans)
### BUGGY CODE ###

#!/usr/bin/env python3

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

N = int(input())
A = list(map(int, input().split()))
dic = {}
for a in A:
    if a in dic: dic[a] += 1
    else: dic[a] = 1

C = {0:0}

sum_ni = 0
for i in range(1, 2*10**5+1):
    C[i] = i*(i-1)//2

ans2 = {}
for k, v in dic.items():
    sum_ni += C[v]



ans = []
for i in range(N):
    dic2 = dic.copy()
    dic2[A[i]] -= 1
    a = sum_ni - C[dic[A[i]]] + C[dic[A[i]]-1]

    ans.append(a)


for a in ans:
    print(a)


### FIXED CODE ###

#!/usr/bin/env python3

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

N = int(input())
A = list(map(int, input().split()))
dic = {}
for a in A:
    if a in dic: dic[a] += 1
    else: dic[a] = 1

C = {0:0}

sum_ni = 0
for i in range(1, N+1):
    C[i] = i*(i-1)//2

D = {}
for k, v in dic.items():
    sum_ni += C[v]


for k, v in dic.items():
    D[k] = sum_ni - C[dic[k]] + C[dic[k]-1]

for i in range(N):
    print(D[A[i]])
### BUGGY CODE ###

N, W = map(int,input().split())

cost = [list(map(int,input().split())) for i in range(N)]
dp = [[0] * (W+1) for i in range(N)]


for i in range(N):
    for sum_w in range(0,W+1):
        if sum_w - cost[i][0] >= 0:
            dp[i][sum_w] = max(dp[i-1][sum_w], dp[i-1][sum_w - cost[i][0]] + cost[i][1])
        dp[i][sum_w] = max(dp[i][sum_w], dp[i-1][sum_w])

print(dp[N-1][W])

### FIXED CODE ###

N, W = map(int,input().split())

cost = [list(map(int,input().split())) for i in range(N)]
dp = [[0] * (W+1) for i in range(N)]


for i in range(N):
    for sum_w in range(0,W+1):
        if sum_w - cost[i][0] >= 0:
            dp[i][sum_w] = max(dp[i-1][sum_w], dp[i-1][sum_w - cost[i][0]] + cost[i][1])
        dp[i][sum_w] = max(dp[i][sum_w], dp[i-1][sum_w])

print(dp[N-1][W])
### BUGGY CODE ###

import collections
import sys

input = sys.stdin.readline

h, w, m = map(int, input().split())


targets = set()
xs = []
ys = []
for _ in range(m):
    y, x = map(int, input().split())
    # y -= 1
    # x -= 1
    ys.append(y)
    xs.append(x)
    targets.add((y, x))

x_stat = collections.Counter(xs)
y_stat = collections.Counter(ys)

xs = sorted(set(xs), key=lambda obj: x_stat[obj], reverse=True)
ys = sorted(set(ys), key=lambda obj: y_stat[obj], reverse=True)

mx_x = x_stat[xs[0]]
mx_y = y_stat[ys[0]]
while xs and x_stat[xs[-1]] < x_stat[xs[0]] - 1:
    xs.pop()
while ys and y_stat[ys[-1]] < y_stat[ys[0]] - 1:
    ys.pop()
best_res = 0
# print(xs, x_stat)
# print(ys, y_stat)
for x in xs:
    for y in ys:
        cur = x_stat[x] + y_stat[y] - ((y, x) in targets)
        best_res = max(cur, best_res)
print(best_res)





### FIXED CODE ###

import collections
import sys

*data, = map(int, sys.stdin.read().split()[::-1])

def inp():
    return data.pop()

h, w, m = inp(), inp(), inp()


targets = set()
xs = []
ys = []
for _ in range(m):
    y, x = inp(), inp()
    # y -= 1
    # x -= 1
    ys.append(y)
    xs.append(x)
    targets.add((y, x))

x_stat = collections.Counter(xs)
y_stat = collections.Counter(ys)

xs = sorted(set(xs), key=lambda obj: x_stat[obj], reverse=True)
ys = sorted(set(ys), key=lambda obj: y_stat[obj], reverse=True)

mx_x = x_stat[xs[0]]
mx_y = y_stat[ys[0]]
while xs and x_stat[xs[-1]] < x_stat[xs[0]]:
    xs.pop()
while ys and y_stat[ys[-1]] < y_stat[ys[0]]:
    ys.pop()
# print(xs, x_stat)
# print(ys, y_stat)

found = False
for x in xs:
    for y in ys:
        if (y, x) not in targets:
            found = True
            break
ans = mx_y + mx_x
if not found:
    ans -= 1
print(ans)
### BUGGY CODE ###

N = int(input())
Alist = list(map(int, input().split()))
Alist = [Alist[i] - (i+1) for i in range(N)]
Alist.sort()

if N == 1:
    print(0)
else:    
    sumlist = []
    for i in range(N-1):
        if i < N // 2:
            sumlist.append(- sum(Alist[:i+1]) + sum(Alist[i+1:]) - Alist[i+1] * (N - 2 * (i + 1)))
        else:
            sumlist.append(- sum(Alist[:i+1]) + sum(Alist[i+1:]) + Alist[i] * (N - 2 * (N - i - 1)))
        
    print(min(sumlist))


### FIXED CODE ###

N = int(input())
Alist = list(map(int, input().split()))
Alist = [Alist[i] - (i+1) for i in range(N)]
Alist.sort()

b = Alist[N//2]

ans = 0
for i in range(N):
    ans += abs(Alist[i] - b)
print(ans)
### BUGGY CODE ###

n,q=map(int,input().split())
s=input()
for i in range(q):
  l,r=map(int,input().split())
  print(s[l-1:r].count("AC"))

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
T=[0]*(n+1)
for i in range(n-1):
  T[i+2]=T[i+1]+[0,1][s[i:i+2]=="AC"]
for _ in range(q):
  l,r=map(int,input().split())
  print(T[r]-T[l-1]-[0,1][s[l-2:l]=="AC"])
### BUGGY CODE ###

N,M,Q = [int(x) for x in input().split()]
ll = [[0] * (N+1) for i in range(N+1)]
for i in range(M):
    l,r = [int(x) for x in input().split()]
    ll[l][r] += 1
for i in range(1,N+1):
    for j in range(1,N+1):
        ll[i][j] += ll[i-1][j]
for i in range(Q):
    ans = 0
    p,q = [int(x) for x in input().split()]
    for i in range(p,q+1):
        ans += ll[q][i]-ll[p-1][i]
    print(ans)

### FIXED CODE ###

N,M,Q = [int(x) for x in input().split()]
ll = [[0] * (N+1) for i in range(N+1)]
for i in range(M):
    l,r = [int(x) for x in input().split()]
    ll[l][r] += 1
for i in range(1,N+1):
    for j in range(1,N+1):
        ll[i][j] += ll[i-1][j]
for i in range(Q):
    ans = 0
    p,q = [int(x) for x in input().split()]
    for i in range(p,q+1):
        ans += ll[q][i]-ll[p-1][i]
    print(ans)
### BUGGY CODE ###

n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
r=[0]*n
count=0
for i in range(n-1):
    if s[i]=='A':
        if s[i+1]=='C':
            r[i+1]=1
        else:
            pass
for i in range(q):
    print(sum(r[:v[i][1]])-sum(r[:v[i][0]]))

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
r=[0]*n
count=0
a=0
for i in range(n-1):
    r[i]=a
    if s[i]=='A':
        if s[i+1]=='C':
            a+=1
        else:
            pass
r[n-1]=a
for i in range(q):
    print(r[v[i][1]-1]-r[v[i][0]-1])
### BUGGY CODE ###

import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n=INT()
    a=np.array(LIST())
    ans=0
    mod=10**9+7
    for i in range(70):
        digit=sum((a>>i)&1)
        ans+=pow(2,i,mod)*(((n-digit)*digit)%mod)
        ans=ans%mod
    
    print(ans)



if __name__=='__main__':
    do()

### FIXED CODE ###

import numpy as np
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n=INT()
    a=np.array(LIST())
    ans=0
    mod=10**9+7
    for i in range(70):
        digit=np.sum((a>>i)&1)
        ans+=pow(2,i,mod)*(((n-digit)*digit)%mod)%mod
        ans=ans%mod
    
    print(ans)



if __name__=='__main__':
    do()
### BUGGY CODE ###

K = int(input())

if K%2 == 0:
    print(-1)

suretu = 7
i = 1
while 1:
    if suretu%K == 0:
        print(i)
        break
    else:
        i += 1
        suretu *= 10
        suretu += 7

### FIXED CODE ###

K = int(input())
remainder_set = set()
sequence = 7
i = 1
for i in range(K):
    remainder = sequence%K
    #print(sequence,remainder)
    if remainder == 0:
        print(i+1)
        break
    else:
        if remainder in remainder_set:
            print(-1)
            break
        else:
            i += 1
            remainder_set.add(remainder)
            sequence = remainder*10 + 7
### BUGGY CODE ###

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
K = 60

ans = 0
mod = 10 ** 9 + 7

for i in range(K):
    bit = sum(A >> i & 1)
    ans += pow(2, i, mod) * (bit * (N - bit))
    ans %= mod

print(ans)

### FIXED CODE ###

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))

K = len(bin(np.max(A))) - 2

ans = 0
mod = 10 ** 9 + 7
N %= mod

for i in range(K):
    bit = np.count_nonzero(A >> i & 1) % mod
    ans += 2 ** i * bit * (N - bit)
    ans %= mod
    
print(ans)
### BUGGY CODE ###

import sys
import numpy as np
from itertools import groupby
def input(): return sys.stdin.readline().rstrip()


def lamp(arr):
    count = np.zeros_like(arr,dtype = int)
    for i in range(arr.shape[0]):
        lamp = []
        for key, value in groupby(arr[i]):
            n=int(len(list(value)))
            if key == '.':
                lamp+=[n]*n
            else:
                lamp+=[0]*n
        count[i]=np.array(lamp)
    return count



def main():
    h, w = map(int, input().split())
    s = np.array([list(input()) for i in range(h)])
    print(np.max(lamp(s)+lamp(s.T).T)-1)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from itertools import groupby, chain
def input(): return sys.stdin.readline().rstrip()


def trans(l_2d):
    return [list(x) for x in zip(*l_2d)]


def lamp(arr):
    count = [[] for i in range(len(arr))]
    for i in range(len(arr)):
        lamps = []
        for key, value in groupby(arr[i]):
            n = int(len(list(value)))
            if key == '.':
                lamps += [n]*n
            else:
                lamps += [0]*n
        count[i] = lamps
    return count


def main():
    h, w = map(int, input().split())
    s = [list(input()) for i in range(h)]
    tate = lamp(s)
    yoko = lamp(trans(s))
    ans=0
    for hh in range(h):
        for ww in range(w):
            ans=max(ans,tate[hh][ww]+yoko[ww][hh]-1)
    print(ans)
        


if __name__ == '__main__':
    main()
### BUGGY CODE ###

N = int(input())
L = list(map(int, input().split(" ")))
L.sort() #小さい順
counter = 0

for num_1, i in enumerate(L):
  for num_2, j in enumerate(L):
    if num_1 <= num_2:
      break
    else:
      for num_3, k in enumerate(L):
        if num_2 <= num_3:
          break
        else:
          if j + k <= i:
            continue
          else:
            counter += 1
print(counter)

### FIXED CODE ###

import bisect

N = int(input())
L = list(map(int, input().split(" ")))
L.sort() #小さい順
counter = 0

for i in range(N-2):
  for j in range(i+1, N-1):
    index = bisect.bisect_left(L, L[i]+L[j], 0, N)
    counter = counter + index - j - 1
       
print(counter)
### BUGGY CODE ###

N = int(input())
A = [int(a) for a in input().split()]
B = [int(b) for b in input().split()]
C = [int(c) for c in input().split()]

ans = 0
AA = list(tuple(A))
CC = list(tuple(C))

for i in range(N):
  AA = list(tuple(A))
  CC = list(tuple(C))
  b = B[i]
  
  AA.append(b)
  AA.sort()
  idx_b_AA = AA.index(b)
  
  CC.append(b)
  CC.sort(reverse=True)
  idx_b_CC = CC.index(b)
  
  ans += idx_b_AA * idx_b_CC

print(ans)

### FIXED CODE ###

N = int(input())
A = sorted([int(a) for a in input().split()])
B = [int(b) for b in input().split()]
C = sorted([int(c) for c in input().split()])
ans = 0

import bisect
for i in range(N):
  b = B[i]
  end_A = bisect.bisect_left(A, b)
  start_C = bisect.bisect_right(C, b)
  ans += end_A * (N - start_C)

print(ans)
### BUGGY CODE ###

N, K = map(int, input().split())
dK = 2*K

MeetDemand =[[0 for c in range(dK+1)] for r in range(dK)]
for i in range(N):
    x, y, c =input().split()
    x = int(x)
    y = int(y)
    if c == "W":
        y += K
    x %= dK
    y %= dK
    if 0 <= x < K and 0 <= y < K:
        MeetDemand[0][0] += 1
        MeetDemand[x+1][y+1] += 2
        MeetDemand[0][y+1] -= 1
        MeetDemand[x+1][0] -= 1
        MeetDemand[0][y+K+1] += 1
        MeetDemand[x+1][y+K+1] -= 2
    elif 0 <= x < K:
        MeetDemand[0][y-K+1] += 1
        MeetDemand[x+1][y-K+1] -= 2
        MeetDemand[x+1][0] += 1
        MeetDemand[0][y+1] -= 1
        MeetDemand[x+1][y+1] += 2
    elif 0 <= y < K:
        MeetDemand[x-K+1][0] += 1
        MeetDemand[x-K+1][y+1] -= 2
        MeetDemand[0][y+1] += 1
        MeetDemand[0][y+K+1] -= 1
        MeetDemand[x-K+1][y+K+1] += 2
    else:
        MeetDemand[0][0] += 1
        MeetDemand[0][y-K+1] -= 1
        MeetDemand[x-K+1][0] -= 1
        MeetDemand[x-K+1][y-K+1] += 2
        MeetDemand[0][y+1] += 1
        MeetDemand[x-K+1][y+1] -= 2

for x in range(K+1):
    for y in range(1, dK+1):
        MeetDemand[x][y] += MeetDemand[x][y-1]
Ans = max(MeetDemand[0][:dK+1])
for y in range(dK+1):
    for x in range(1, K+1):
        MeetDemand[x][y] += MeetDemand[x-1][y]
        Ans = max(Ans, MeetDemand[x][y])
print(Ans)

### FIXED CODE ###

N, K = map(int, input().split())
dK = 2*K

MeetDemand =[[0 for y in range(dK+1)] for x in range(K+1)]
for i in range(N):
    x, y, c =input().split()
    x = int(x) % dK
    y = (int(y)+K if c=="W" else int(y)) % dK
    if K <= x:
        if 0 <= y < K:
            x -= K
            y += K
        else:
            x %= K
            y %= K
    if 0 <= y < K:
        MeetDemand[0][0] += 1
        MeetDemand[x+1][y+1] += 2
        MeetDemand[0][y+1] -= 1
        MeetDemand[x+1][0] -= 1
        MeetDemand[0][y+K+1] += 1
        MeetDemand[x+1][y+K+1] -= 2
    else:
        MeetDemand[0][y-K+1] += 1
        MeetDemand[x+1][y-K+1] -= 2
        MeetDemand[x+1][0] += 1
        MeetDemand[0][y+1] -= 1
        MeetDemand[x+1][y+1] += 2

for x in range(K):
    for y in range(1, dK):
        MeetDemand[x][y] += MeetDemand[x][y-1]
for y in range(dK):
    for x in range(1, K):
        MeetDemand[x][y] += MeetDemand[x-1][y]

Ans = max(MeetDemand[0][:dK])
for i in range(1, K):
    Ans = max(Ans, max(MeetDemand[i][:dK]))
print(Ans)
### BUGGY CODE ###

import sys
import math
import functools
from collections import deque
sin = sys.stdin

nk = sin.readline().split()
n = int(nk[0])
k = int(nk[1])
heights = [int(i) for i in sin.readline().split()]
lowestCost = [0 for i in range(n)]

lowestCost[0] = 0
lowestCost[1] = abs(heights[1] - heights[0])

for i in range(2, n):
    m = float('inf')
    for j in range(i-k, i):
        if j >= 0:
            m = min(m, lowestCost[j] + abs(heights[j] - heights[i]))
    lowestCost[i] = m

print(lowestCost[n-1])


### FIXED CODE ###

import sys
import math
import functools
from collections import deque
sin = sys.stdin

nk = sin.readline().split()
n = int(nk[0])
k = int(nk[1])
heights = [int(i) for i in sin.readline().split()]
lowestCost = [0 for i in range(n)]

lowestCost[0] = 0
lowestCost[1] = abs(heights[1] - heights[0])

for i in range(2, n):
    m = float('inf')
    for j in range(i-k, i):
        if j >= 0:
            m = min(m, lowestCost[j] + abs(heights[j] - heights[i]))
    lowestCost[i] = m

print(lowestCost[n-1])
### BUGGY CODE ###

import numpy as np

N = int(input())

inp = map(int,input().split(' '))

A = [int(i) for i in inp]

X = [np.hstack(([0],np.delete(A, i))) for i in range(N)]
Y = [np.hstack((np.delete(A, i),[0])) for i in range(N)]

Ans = [sum(np.abs(X[i]-Y[i])) for i in range(N)]

for i in range(N):
    print(int(Ans[i]))


### FIXED CODE ###

import numpy as np

N = int(input())

inp = map(int,input().split(' '))

A = [0] + [int(i) for i in inp] + [0]
s = np.sum(np.abs(np.diff(A,n=1)))

for j in range(1,N+1):
    df = np.abs(A[j+1]-A[j-1]) - np.abs(A[j]-A[j-1]) - np.abs(A[j+1]-A[j])
    print(int(s+df))
### BUGGY CODE ###

import sys
import bisect
import math
import itertools
from collections import deque


# \n
def input():
    return sys.stdin.readline().rstrip()


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

    L = [[] for _ in range(N + 1)]

    for i in range(N):
        a = list(map(int, input().split()))
        L[i + 1] = deque(a)

    f_original = [False] * (N + 1)
    f = [False] * (N + 1)
    k = 0
    while k<500000: # １日分の作業
        f =[False] * (N + 1)
        for i in range(1, N + 1): #一人分の作業
            if not L[i]:
                continue
            can = L[i][0]
            if L[can][0] == i and f[can] is False and f[i]is False:
                L[i].popleft()
                L[can].popleft()
                f[i] = True
                f[can] = True
        k += 1
        if f == f_original:
            break

    for i in range(N + 1):
        if len(L[i])>0:
            print(-1)
            exit()

    print(k-1)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import bisect
import math
import itertools
from collections import deque
import copy

# \n
def input():
    return sys.stdin.readline().rstrip()


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

    L = [[] for _ in range(N + 1)]

    for j in range(N):
        a = list(map(int, input().split()))
        L[j + 1] = deque(a)


    k =0

    current_revise =set(range(N+1))
    while k<50000000: # １日分の作業

        pre_revise =copy.copy(current_revise)
        current_revise =set()

        for i in pre_revise: #一人分の作業
            if not L[i]:
                continue
            can = L[i][0]
            if L[can][0] == i and i not in current_revise and can not in current_revise:
                L[i].popleft()
                L[can].popleft()

                current_revise.add(i)
                current_revise.add(can)
        k += 1

        if len(current_revise)==0:
            break


    for i in range(N + 1):
        if len(L[i])>0:
            print(-1)
            exit()

    print(k-1)

if __name__ == "__main__":
    main()
### BUGGY CODE ###

def main():
    from collections import Counter
    from functools import lru_cache
    from copy import deepcopy
    N = int(input())
    X = [i for i in range(N + 1)]
    prime = [2, ]
    for i in range(3, N + 1):
        x = int(i ** 0.5) + 1
        for p in prime:
            if p > x:
                prime.append(i)
                break
            if i % p == 0:
                X[i] = p
                break
        else:
            prime.append(i)

    @lru_cache(maxsize=None)
    def lis(n):
        if n == 1:
            return dict()
        a = X[n]
        if a == n:
            C = dict()
            C[a] = 1
        else:
            C = deepcopy(lis(n // a))
            if C.get(a):
                C[a] += 1
            else:
                C[a] = 1
        return C

    A = 0

    for i in range(1, N + 1):
        Cl = lis(i)
        ans = 1
        for v in Cl.values():
            ans *= v + 1
        A += ans * i

    print(A)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    ans = 0
    x = n // 2
    for i in range(1, n + 1):
        m = n // i
        ans += i * ((m + 1) * m) // 2
    print(ans)


if __name__ == "__main__":
    main()