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

N = int(input())
inputs = [float(i) for i in input().split()]

dp = [[0.0 for _ in range(N+1)] for _ in range(N+1)]
dp[1][0] = 1 - inputs[0]
dp[1][1] = inputs[0]
for i in range(2, N+1):
    for j in range(N+1):
        if j == 0:
            dp[i][j] = dp[i-1][j] * (1 - inputs[i-1])
        else:
            dp[i][j] = dp[i-1][j] * (1 - inputs[i-1]) + dp[i-1][j-1] * inputs[i-1]

print(sum(dp[-1][(N+1)//2:]))


### FIXED CODE ###

import numpy as np

N = int(input())
inputs = np.array([float(i) for i in input().split()])

dp = np.array([np.array([0.0 for _ in range(N+1)]) for _ in range(N+1)])
dp[1][0] = 1 - inputs[0]
dp[1][1] = inputs[0]
for i in range(2, N+1):
    dp[i][1:] = dp[i-1][1:] * (1.0 - inputs[i-1]) + dp[i-1][:N] * inputs[i-1]
    dp[i][0] = dp[i-1][0] * (1.0 - inputs[i-1])

print(sum(dp[-1][(N+1)//2:]))
### BUGGY CODE ###

n=int(input())
result=1000000000000
for i in range(n):
  nn=n/(i+1)
  if (nn.is_integer() and result>nn+i-1):
    result=nn+i-1
print(int(result))


### FIXED CODE ###

n = int(input())
list=[]
for i in range(1,int(n**0.5+1)):
  if n%i == 0:
    list.append(int(i+n/i))
print(min(list)-2)
### BUGGY CODE ###

Q = int(input())
mod = int(1e+6 + 3)
def gcd(a, b):
  p, q = a, b
  while q != 0:
    a, b = b, a % b
  return a
def doublestep(a):
  li = []
  while a != 0:
    li = [a%2] + li[:]
    a //= 2
  return li
def doubling(z, num):
  y = doublestep(num)
  tet = 1
  for i in range(len(y)):
    if y[i] == 1:
      tet *= z
      tet %= mod
    if i != len(y) - 1:
      tet *= tet
      tet %= mod
  return tet
frac = [1]
for i in range(2 * mod):
  frac.append((frac[i]*(i+1))%mod)
for i in range(Q):
  x, d, n = map(int, input().split())
  if x == 0:
    print(0)
  else:
    if d == 0:
      print(doubling(x, n))
    else:
      if n >= mod:
        print(0)
      else:
        dn = doubling(d, n)
        xinvd = x * doubling(d, mod - 2) - 1
        xinvd %= mod
        print((dn * frac[xinvd + n] * doubling(frac[xinvd], mod - 2)) % mod)

### FIXED CODE ###

Q = int(input())
mod = int(1e+6 + 3)

def doubling(n, m):
  y = 1
  p = n
  while m != 0:
    if m % 2 == 1:
      y *= p
      y %= mod
    m //= 2
    p *= p
    p %= mod
  return y

def inved(s):
  x, y, u, v, k, l = 1, 0, 0, 1, s, mod
  while l != 0:
    x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
    k, l = l, k % l
  return x % mod

frac = [1 for _ in range(mod+1)]
invf = [1 for _ in range(mod+1)]
invf[mod] = 0
for i in range(mod):
  frac[i+1] = (frac[i] * (i+1)) % mod
invf[mod-1] = inved(frac[mod-1])
for i in range(mod-1, 0, -1):
  invf[i-1] = (invf[i] * i) % mod

for i in range(Q):
  x, d, n = map(int, input().split())
  if x == 0:
    print(0)
  else:
    if d == 0:
      print(doubling(x, n))
    else:
      if n >= mod:
        print(0)
      else:
        xinvd = x * inved(d) - 1
        xinvd %= mod
        if xinvd + n >= mod:
          print(0)
        else:
          dn = doubling(d, n)
          print((dn * frac[xinvd + n] * invf[xinvd]) % mod)
### BUGGY CODE ###

from fractions import gcd
n = int(input())
a = [int(i) for i in input().split()]

b = 1
for i in a:
    b = b * i // gcd(b, i)

ans = 0
for i in a:
    ans += b // i
    ans %= 10**9+7

print(ans)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
p = 10 ** 9 + 7

def pr(x):
    a=[]
    i=2
    while True:
        if x % i == 0:
            j=0
            while x % i == 0:
                x //= i
                j += 1
            a.append((i, j))
        if i * i > x:
            break
        i += 1
    if x != 1:
        a.append((x,1))
    return a
c = {}
for i in a:
    d = pr(i)
    for j in d:
        if j[0] in c:
            c[j[0]] = max(c[j[0]], j[1])
        else:
            c[j[0]] = j[1]

b = 1
for i in c:
    b *= pow(i, c[i], p)
    b %= p
ans = 0
for i in a:
    ans += b * pow(i, p - 2, p)
    ans %= p
print(ans)
### BUGGY CODE ###

# coding: utf-8
# Your code here!

from collections import deque
# from pprint import pprint
moves=[(0,1),(1,0),(0,-1),(-1,0)]
# pp=pprint
INF=float("inf")

h,w,k=map(int,input().split())
x1,y1,x2,y2=map(lambda x:int(x)-1,input().split())
maze=[list(input()) for _ in range(h)]
cost=[[INF]*w for _ in range(h)]

todo=deque()
todo.append((x1,y1))
cost[x1][y1]=0

while todo:
    x,y=todo.popleft()
    for vx,vy in moves:
        for kk in range(1,k+1):
            nx=x+vx*kk
            ny=y+vy*kk
            if not(0<=nx<h) or not(0<=ny<w):
                break
                # 更に伸ばす必要はない
            if maze[nx][ny]=="@":
                break
                # 蓮の向こうにはいけないので
            if cost[nx][ny]<=cost[x][y]:
                break
                # 更新を1回以上受けていて、更に良くならない場合はbreak
            # if cost[nx][ny]==INF:
            cost[nx][ny]=cost[x][y]+1
            todo.append((nx,ny))
                # 更新されてなければ、[x][y]から1マス先を更新、キューに突っ込む


# pp(cost)
ans=cost[x2][y2]
if ans==INF:ans=-1
print(ans)

### FIXED CODE ###

# coding: utf-8
# Your code here!

from collections import deque
from pprint import pprint
moves=[(0,1),(1,0),(0,-1),(-1,0)]
pp=pprint
# INF=float("inf")

h,w,k=map(int,input().split())
x1,y1,x2,y2=map(lambda x:int(x)-1,input().split())
maze=[list(input()) for _ in range(h)]
cost=[[-1]*w for _ in range(h)]

todo=deque()
todo.append((x1,y1))
cost[x1][y1]=0

while todo:
    x,y=todo.popleft()
    for vx,vy in moves:
        for kk in range(1,k+1):
            nx=x+vx*kk
            ny=y+vy*kk
            if not(0<=nx<h) or not(0<=ny<w):
                continue
            if maze[nx][ny]=="@":
                break
            if cost[nx][ny]!=-1 and cost[nx][ny]<=cost[x][y]:
                break
            if cost[nx][ny]!=-1:
                continue
            cost[nx][ny]=cost[x][y]+1
            todo.append((nx,ny))


# pp(cost)
ans=cost[x2][y2]
print(ans)
### BUGGY CODE ###

from collections import deque
h,w=(int(i) for i in input().split())
#print(h,w)

a=[[i for i in input()] for j in range(h)]
#print(a)

start=deque([])
goal=deque([])
for i in range(h):
    for j in range(w):
        if a[i][j]=='.':
            goal.append((i,j))
        else:
            start.append((i,j))
#print(goal)
#print(start)

cnt=0
for i in range(len(goal)):
    cnt1=2010    
    for j in range(len(start)):
        length=abs(goal[i][0]-start[j][0])+abs(goal[i][1]-start[j][1])
        if length < cnt1:
            cnt1= length
    if cnt < cnt1:
        cnt = cnt1
print(cnt)




### FIXED CODE ###

from collections import deque
h,w=(int(i) for i in input().split())
#print(h,w)

a=[[i for i in input()] for j in range(h)]
#print(a)

cnt=0
ans=0
black=deque([])
for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            cnt+=1
            black.append((i,j))
dy=deque([1,0,-1,0])
dx=deque([0,1,0,-1])
#print(black)
#print(cnt)

while cnt<h*w:
    for i in range(len(black)):
        data=black.popleft()
        for j in range(4):
            if 0<=data[0]+dy[j]<h and 0<=data[1]+dx[j]<w:
                if a[data[0]+dy[j]][data[1]+dx[j]]=='.':
                    a[data[0]+dy[j]][data[1]+dx[j]]='#'
                    cnt+=1
                    black.append((data[0]+dy[j],data[1]+dx[j]))
    ans+=1
    
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
from collections import deque

H,W=map(int,input().split())
sh,sw=map(int,input().split())
gh,gw=map(int,input().split())
MAP=[input().strip() for i in range(H)]

ANS=[[1<<30]*W for i in range(H)]

sh-=1
sw-=1
gh-=1
gw-=1

ANS[sh][sw]=0

Q=deque([(sh,sw)])

while Q:
    x,y=Q.popleft()

    for i,j in [(x-2,y-2),(x-2,y-1),(x-2,y),(x-2,y+1),(x-2,y+2),(x-1,y-2),(x-1,y-1),(x-1,y),(x-1,y+1),(x-1,y+2),(x,y-2),(x,y-1),(x,y+1),(x,y+2),(x+1,y-2),(x+1,y-1),(x+1,y),(x+1,y+1),(x+1,y+2),(x+2,y-2),(x+2,y-1),(x+2,y),(x+2,y+1),(x+2,y+2)]:
        if 0<=i<H and 0<=j<W:
            if MAP[i][j]=="." and abs(i-x)+abs(j-y)==1 and ANS[i][j]>ANS[x][y]:
                ANS[i][j]=ANS[x][y]
                Q.append((i,j))
            elif MAP[i][j]=="." and abs(i-x)+abs(j-y)>1 and ANS[i][j]>ANS[x][y]+1:
                ANS[i][j]=ANS[x][y]+1
                Q.append((i,j))

if ANS[gh][gw]==1<<30:
    print(-1)
else:
    print(ANS[gh][gw])



### FIXED CODE ###

import sys
input = sys.stdin.readline
import heapq

H,W=map(int,input().split())
sh,sw=map(int,input().split())
gh,gw=map(int,input().split())
MAP=[input().strip() for i in range(H)]

ANS=[[1<<30]*W for i in range(H)]

sh-=1
sw-=1
gh-=1
gw-=1

ANS[sh][sw]=0

def ca(sc,x,y):
    return sc*(10**8)+x*(10**4)+y

def inv(w):
    sc=w//(10**8)
    w%=(10**8)
    x=w//(10**4)
    y=w%(10**4)

    return sc,x,y

Q=[ca(0,sh,sw)]

while Q:
    sc,x,y=inv(heapq.heappop(Q))

    if sc>ANS[x][y]:
        continue

    for i,j in [(x-2,y-2),(x-2,y-1),(x-2,y),(x-2,y+1),(x-2,y+2),(x-1,y-2),(x-1,y-1),(x-1,y),(x-1,y+1),(x-1,y+2),(x,y-2),(x,y-1),(x,y+1),(x,y+2),(x+1,y-2),(x+1,y-1),(x+1,y),(x+1,y+1),(x+1,y+2),(x+2,y-2),(x+2,y-1),(x+2,y),(x+2,y+1),(x+2,y+2)]:
        if 0<=i<H and 0<=j<W:
            if MAP[i][j]=="." and abs(i-x)+abs(j-y)==1 and ANS[i][j]>sc:
                ANS[i][j]=sc
                heapq.heappush(Q,ca(ANS[i][j],i,j))
            elif MAP[i][j]=="." and abs(i-x)+abs(j-y)>1 and ANS[i][j]>sc+1:
                ANS[i][j]=sc+1
                heapq.heappush(Q,ca(ANS[i][j],i,j))

if ANS[gh][gw]==1<<30:
    print(-1)
else:
    print(ANS[gh][gw])
### BUGGY CODE ###

'use strict'
import math
N, M = map(int, input().split())
goods_price_list = (list(map(int, input().split())))
goods_price_list.sort(reverse=True)

if len(goods_price_list) == 1:
  for i in range(M):
    goods_price_list[0] = math.floor(goods_price_list[0]/2)

else:
  for i in range(M):
    goods_price_list[0] = math.floor(goods_price_list[0]/2)
    
    if goods_price_list[0] < goods_price_list[1]:
      num = 1
      while goods_price_list[0] <= goods_price_list[num]:
        num += 1
        if num == len(goods_price_list):
          break

      goods_price_list.insert(num,goods_price_list[0])
      del goods_price_list[0]

print(sum(goods_price_list))

### FIXED CODE ###

'use strict'
import heapq

N, M = map(int, input().split())
goods_price_list = [-int(_) for _ in input().split()]

heapq.heapify(goods_price_list)

for i in range(M):
  heapq.heappush(goods_price_list, -((-heapq.heappop(goods_price_list) // 2)))

print(-sum(goods_price_list))
### BUGGY CODE ###

import itertools
import math

N, K = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)

mod = 10**9+7

# print(list(itertools.combinations(range(6), 3)))
# A = range(6)
# N = 6
# K = 3

# 二項係数を素数で割った余り
def combMod(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    # fact = [-1 for _ in range(n+1)]
    # fact[0] = 1
    # fact[1] = 1
    # inv = [-1 for _ in range(n+1)]
    # inv[0] = 0
    # inv[1] = 1
    # factinv = [-1 for _ in range(n+1)]
    # factinv[0] = 1
    # factinv[1] = 1
    fact = [1, 1]
    factinv = [1, 1]
    inv = [0, 1]
    
    for i in range(2, n + 1):
        # fact[i] = ((fact[i-1] * i) % p)
        # inv[i] = ((-inv[p % i] * (p // i)) % p)
        # factinv[i] = ((factinv[i-1] * inv[i]) % p)
        fact.append((fact[-1] * i) % p)
        inv.append((-inv[p % i] * (p // i)) % p)
        factinv.append((factinv[-1] * inv[-1]) % p)


    return fact[n] * factinv[r] * factinv[n-r] % p


ans = 0
for i in range(N):
    num = combMod(i, K-1, mod)
    ans += num * A[i] % mod
    ans -= num * A[N-i-1] % mod

print(ans%mod)

### FIXED CODE ###

# import itertools
# import math

N, K = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A)

mod = 10**9+7

# print(list(itertools.combinations(range(6), 3)))
# A = range(6)
# N = 6
# K = 3

# 二項係数を素数で割った余り
def combMod(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p
    # fact = [-1 for _ in range(n+1)]
    # fact[0] = 1
    # fact[1] = 1
    # inv = [-1 for _ in range(n+1)]
    # inv[0] = 0
    # inv[1] = 1
    # factinv = [-1 for _ in range(n+1)]
    # factinv[0] = 1
    # factinv[1] = 1
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
p = mod
    
for i in range(2, N + 1):
    # fact[i] = ((fact[i-1] * i) % p)
    # inv[i] = ((-inv[p % i] * (p // i)) % p)
    # factinv[i] = ((factinv[i-1] * inv[i]) % p)
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)




ans = 0
for i in range(N):
    num = combMod(i, K-1, mod) % mod
    ans += num * A[i] % mod
    ans -= num * A[N-i-1] % mod
    ans %= mod

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

def main():
    N, M, P = map(int, input().split())
    Edge = []
    for i in range(M):
        a, b, c = map(int, input().split())
        a, b = a - 1, b - 1
        c = -(c - P)
        Edge.append([a, b, c])

    # ベルマンフォード
    dist = [float('inf')] * N
    dist[0] = 0

    for i in range(2 * N):
        for fr, to, cost in Edge:
            if (dist[fr] != float('inf')) and (dist[to] > dist[fr] + cost):
                dist[to] = dist[fr] + cost
                if (i >= N) & (to == N - 1):
                    print(-1)
                    exit()

    print(max(0, -dist[N - 1]) if -dist[N - 1] != float('inf') else 0)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
N, M, P = map(int, input().split())
Edge = []
G = [[] for i in range(N)]
G_rev = [[] for i in range(N)]
for i in range(M):
    a, b, c = map(int, sys.stdin.readline().split())
    a, b = a - 1, b - 1
    c = -(c - P)
    Edge.append([a, b, c])
    G[a].append(b)
    G_rev[b].append(a)


# 0とNの両方から辿れない頂点を削除
def dfs(g, stack):
    can_reach = set()
    while stack:
        n = stack.pop()
        can_reach.add(n)
        for to in g[n]:
            if to in can_reach:
                continue
            stack.append(to)
    return can_reach


can_reach_from_0 = dfs(G, [0])
can_reach_from_N = dfs(G_rev, [N - 1])

can_reach_from_0_and_N = can_reach_from_0 & can_reach_from_N
EdgeShifted = []
for a, b, c in Edge:
    if (a in can_reach_from_0_and_N) and (b in can_reach_from_0_and_N):
        EdgeShifted.append([a, b, c])


# ベルマンフォード
dist = [float('inf')] * N
dist[0] = 0

for n in range(len(can_reach_from_0_and_N)):
    for fr, to, cost in EdgeShifted:
        if dist[to] > dist[fr] + cost:
            dist[to] = dist[fr] + cost
            # 負閉路検出
            if n == len(can_reach_from_0_and_N) - 1:
                print(-1)
                exit()

print(max(0, -dist[N - 1]))
### BUGGY CODE ###

def telepo_test(start, goal, delta, board):
    route = [start + delta * i for i in range(abs(goal - start) // abs(delta) + 1)]
    route = [get_coordinate(r, board) for r in route]

    mp = 0
    for s, t in zip(route[:-1], route[1:]):
        mp += abs(t[0] - s[0]) + abs(t[1] - s[1])
    return mp


def get_coordinate(n, board):
    for c, r in enumerate(board):
        if n not in r:
            continue
        return (c, r.index(n))
    else:
        return None


H, W, D = tuple(map(int, input().split()))
board = [tuple(map(int, input().split())) for _ in range(H)]
Q = int(input())

LRs = [tuple(map(int, input().split())) for _ in range(Q)]

result = [telepo_test(LR[0], LR[1], D, board) for LR in LRs]
for r in result:
    print(r)

### FIXED CODE ###

def telepo_test(start, goal, delta, board):
    route = [start + delta * i for i in range(abs(goal - start) // abs(delta) + 1)]
    route = [board[r] for r in route]

    mp = 0
    for s, t in zip(route[:-1], route[1:]):
        print(s,t)
        mp += abs(t[0] - s[0]) + abs(t[1] - s[1])
    return mp


H, W, D = tuple(map(int, input().split()))
board = dict()
for h in range(H):
    row = tuple(map(int, input().split()))
    for w in range(W):
        board[row[w]] = (h, w)
delta = dict([(i, 0) for i in range(1, D+1)])
for d in range(D+1, H*W+1):
    delta[d] = delta[d-D] + abs(board[d][0] - board[d-D][0]) + abs(board[d][1] - board[d-D][1])

Q = int(input())

LRs = [tuple(map(int, input().split())) for _ in range(Q)]
result = [delta[LR[1]] - delta[LR[0]] for LR in LRs]

for r in result:
    print(r)
### BUGGY CODE ###

k,s = map(int,input().split())

cnt=0
for i in range(k+1):
  for j in range(k+1):
    for l in range(k+1):
      if i+j+l==s:
        cnt+=1

print(cnt)


### FIXED CODE ###

k,s = map(int,input().split())

cnt=0
for i in range(k+1):
  for j in range(k+1):
    l=s-i-j
    if 0<=l<=k:
      cnt+=1

print(cnt)
### BUGGY CODE ###

from pprint import pprint
from collections import deque, defaultdict


def solve(n, q, edges, p):
    counter = defaultdict(int)

    parents = deque()
    # parents.append(0)
    # parents = []
    parents.append(0)
    visited = set()
    while parents:
        parent = parents.popleft()
        # parent = parents.pop()
        if parent in visited:
            continue
        visited.add(parent)
        counter[parent] += p[parent]
        # print("parent")
        # print(parent, counter[parent])
        if parent in edges:
            for child in edges[parent]:
                if child in visited:
                    continue
                # if counter[child] != 0:
                #    continue
                counter[child] = counter[parent]
                # print("child")
                # print(child, counter[child])
                parents.append(child)
                # parents.add(child)

    print(" ".join(list(map(str, counter.values()))))

if __name__ == "__main__":
    n, q = list(map(int, input().strip().split(" ")))
    edges = defaultdict(set)
    for _ in range(n-1):
        a_i, b_i = list(map(int, input().strip().split(" ")))
        # edges[a_i-1].append(b_i-1)
        # edges[b_i-1].append(a_i-1)
        edges[a_i-1].add(b_i-1)
        edges[b_i-1].add(a_i-1)

    p = defaultdict(int)
    x = []
    for _ in range(q):
        p_i, x_i = list(map(int, input().strip().split(" ")))
        p[p_i-1] += x_i

    solve(n, q, edges, p)

### FIXED CODE ###

from collections import deque


def solve(n, q, a, b, p, x):
    counter = [0] * n
    q_sum = [0] * n
    for i in range(q):
        q_sum[p[i]] += x[i]
    # pprint(q_sum)

    edges = {}
    for i in range(n-1):
        if a[i] not in edges:
            edges[a[i]] = []
        edges[a[i]].append(b[i])
    # pprint(edges)

    counter[0] = q_sum[0]
    children = deque()
    for child in edges[0]:
        counter[child] = q_sum[0]
        children.append(child)
    while children:
        child = children.popleft()
        counter[child] += q_sum[child]
        # print("child")
        # print(child, counter[child])
        if child in edges:
            for c in edges[child]:
                counter[c] = counter[child]
                # print("c")
                # print(c, counter[c])
                children.append(c)

    print(" ".join(list(map(str, counter))))

if __name__ == "__main__":
    n, q = list(map(int, input().strip().split(" ")))
    a = []
    b = []
    for _ in range(n-1):
        a_i, b_i = list(map(int, input().strip().split(" ")))
        a.append(a_i - 1)
        b.append(b_i - 1)

    p = []
    x = []
    for _ in range(q):
        p_i, x_i = list(map(int, input().strip().split(" ")))
        p.append(p_i-1)
        x.append(x_i)
    solve(n, q, a, b, p, x)
### BUGGY CODE ###


def read_input():
    n = int(input())
    alist = []

    for i in range(n):
        alist.append(int(input()))

    return n, alist


def submit():
    n, alist = read_input()

    paper = {}
    for a in alist:
        if a not in paper.keys():
            paper[a] = 1
        else:
            paper[a] *= -1

    paper_write = [t for t in paper.items() if t[1] == 1]
    print(len(paper_write))

if __name__ == '__main__':
    submit()

### FIXED CODE ###


def read_input():
    n = int(input())
    alist = []

    for i in range(n):
        alist.append(int(input()))

    return n, alist


def submit():
    n, alist = read_input()

    paper = {a: -1 for a in alist}

    for a in alist:
        paper[a] *= -1

    paper_write = [t for t in paper.items() if t[1] == 1]
    print(len(paper_write))

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

N = int(input())
A = list(map(int,input().split()))
MOD = 10 ** 9 + 7

K = [0] * 61
for a in A:
    L = list(format(a, 'b').zfill(61))
    M = list(int(s) for s in L)
    for i in range(61):
        K[i] += M[i]

ans = 0
for i in range(61):
    ans += (2 ** (60 - i)) * K[i] * (N - K[i]) % MOD

print(ans % MOD)

### FIXED CODE ###

import numpy as np
N = int(input())
A = np.array(list(map(int,input().split())))
MOD = 10 ** 9 + 7
ans = 0

for i in range(61):
    cnt = np.count_nonzero(A & 1)
    ans += (2 ** i) * cnt * (N - cnt)
    A >>= 1

print(ans % MOD)
### BUGGY CODE ###

from math import gcd
N = int(input())
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

MAXA = 10**6
B = [0] * (MAXA+1)
for a in A:
    if a==1: continue
    if B[a]:
        print('setwise coprime')
        exit()
    B[a] = 1

for n in range(2,MAXA+1):
    c = 0
    for m in range(n,MAXA+1,n):
        c += B[m]
        if c > 1:
            print('setwise coprime')
            exit()

print('pairwise coprime')

### FIXED CODE ###

from math import gcd
N = int(input())
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

sa = set()
for a in A:
    if a==1: continue
    if a in sa:
        print('setwise coprime')
        exit()
    sa.add(a)

MAXN = 10**6+10
sieve = [0,0] + [1]*MAXN
p = 2
small_primes = []
while p*p <= MAXN:
    if sieve[p]:
        small_primes.append(p)
        for q in range(2*p,MAXN+1,p):
            sieve[q] = 0
    p += 1

st = set()
for a in A:
    for p in small_primes:
        found = False
        while a%p==0:
            a //= p
            found = True
        if found:
            if p in st:
                print('setwise coprime')
                exit()
            st.add(p)
        if a==1: break
    else:
        if a in st:
            print('setwise coprime')
            exit()
        st.add(a)

print('pairwise coprime')
### BUGGY CODE ###

n,k=map(int,input().split())
while 1:
    n=abs(n-k)
    
    if k>=n:
        break
if n>abs(k-n):
    n=k-n
print(n)

### FIXED CODE ###

n,k=map(int,input().split())
a=n%k
b=k-a
if a<b:
    print(a)
else:
    print(b)
### BUGGY CODE ###

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

mod = 1000000000 + 7
ans = 0

for i in range(n):
    for j in range(n):
        pdt = 0
        if i<j:
            pdt = a[i] * a[j]
        ans += pdt

ans %= mod
print(ans)

### FIXED CODE ###

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

mod = 1000000000 + 7
ans = 0

for i in range(n):
    sum_a -= a[i]
    pdt = a[i] * sum_a
    ans += pdt

ans %= mod
print(ans)