Harryxun/stf_run huggingface dataset:
k = int(input())

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

### FIXED CODE ###

k = int(input())

if k % 2 == 0:
    print((k//2)**2)
else:
    print((k//2)*((k//2)+1))
from sys import stdin

def main():

    input = stdin.readline

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

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

    itta_list = set()
    idou_num = 0

    pos = 0

    for i in range(K):
        # itta_list記憶
        if pos not in itta_list:
            itta_list.add(pos)
        else:
            idou_num = i
            break

        # 次の街へ
        pos = A[pos] - 1
    else:
        ans_num = pos + 1
        print(ans_num)
        return

    roop_list = itta_list[itta_list.index(pos):]

    amari = (K - idou_num) % len(roop_list)

    ans_pos = roop_list[amari] + 1

    print(ans_pos)

if __name__ == "__main__":
    main()

### FIXED CODE ###

from sys import stdin

def main():

    input = stdin.readline

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

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

    itta_set = set()
    itta_list = []
    idou_num = 0

    pos = 0

    for i in range(K):
        # itta_list記憶
        if pos not in itta_set:
            itta_set.add(pos)
            itta_list.append(pos)
        else:
            idou_num = i
            break

        # 次の街へ
        pos = A[pos] - 1
    else:
        ans_num = pos + 1
        print(ans_num)
        return

    roop_list = itta_list[itta_list.index(pos):]

    amari = (K - idou_num) % len(roop_list)

    ans_pos = roop_list[amari] + 1

    print(ans_pos)

if __name__ == "__main__":
    main()
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  if a[a[i]-1]=i+1:ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  if a[a[i]-1]==i+1:ans+=1
print(ans//2)
al = [chr(ord('a') + i) for i in range(26)]

H, W = map(int, input().split())
A = [input() for _ in range(H)]

cnt = [0] * 26
for h in range(H):
    for w in range(W):
        cnt[al.index(A[h][w])] += 1
if H == 1 or W == 1:
    check = 0
    for i in range(26):
        if cnt[i] % 2 == 1:
            check += 1
    if check == 1:
        ans = "Yes"
    else:
        ans = "No"
else:
    cnt = [i for i in cnt if i != 0]
    cnt.sort(reverse=True)
    if H % 2 == 1 and W % 2 == 1:
        count = H//2 * W//2
        while count > 0:
            count -= 1
            cnt[0] -= 4
            cnt.sort(reverse=True)
        cnt = [i for i in cnt if i != 0]
        count = H//2 + W//2
        while count > 0:
            count -= 1
            cnt[0] -= 2
            cnt.sort(revese=True)
        cnt = [i for i in cnt if i != 0]
        if cnt[0] == 1 and len(cnt) == 1:
            ans = "Yes"
        else:
            ans = "No"
    elif H % 2 == 0 and W % 2 == 0:
        count = H//2 * W//2
        while count > 0:
            count -= 1
            cnt[0] -= 4
            cnt.sort(reverse=True)
        cnt = list(set(cnt))
        if cnt[0] == 0 and len(cnt) == 1:
            ans = "Yes"
        else:
            ans = "No"
    else:
        count = H//2 * W//2
        while count > 0:
            count -= 1
            cnt[0] -= 4
            cnt.sort(reverse=True)
        cnt = [i for i in cnt if i != 0]
        count = (H%2) * (W//2) + (H//2) * (W%2)
        while count > 0:
            count -= 1
            cnt[0] -= 2
            cnt.sort(reverse=True)
        cnt =list(set(cnt))
        if cnt[0] == 0 and len(cnt) == 1:
            ans = "Yes"
        else:
            ans = "No"
print(ans)

### FIXED CODE ###

al = [chr(ord('a') + i) for i in range(26)]

H, W = map(int, input().split())
A = [input() for _ in range(H)]

cnt = [0] * 26
for h in range(H):
    for w in range(W):
        cnt[al.index(A[h][w])] += 1
cnt = [i for i in cnt if i != 0]
cnt.sort(reverse=True)

if H % 2 == 1 and W % 2 == 1:
    count = (H//2) * (W//2)
    while count > 0:
        count -= 1
        cnt[0] -= 4
        cnt.sort(reverse=True)
    cnt = [i for i in cnt if i != 0]
    count = (H//2) + (W//2)
    while count > 0:
        count -= 1
        cnt[0] -= 2
        cnt.sort(reverse=True)
    cnt = [i for i in cnt if i != 0]
    if sum(cnt) == 1 and len(cnt) == 1:
        ans = "Yes"
    else:
        ans = "No"
elif H % 2 == 0 and W % 2 == 0:
    count = (H//2) * (W//2)
    while count > 0:
        count -= 1
        cnt[0] -= 4
        cnt.sort(reverse=True)
    cnt = list(set(cnt))
    if cnt[0] == 0 and len(cnt) == 1:
        ans = "Yes"
    else:
        ans = "No"
else:
    count = (H//2) * (W//2)
    while count > 0:
        count -= 1
        cnt[0] -= 4
        cnt.sort(reverse=True)
    cnt = [i for i in cnt if i != 0]
    cnt.sort(reverse=True)
    count = (H%2) * (W//2) + (H//2) * (W%2)
    while count > 0:
        count -= 1
        cnt[0] -= 2
        cnt.sort(reverse=True)
    cnt =list(set(cnt))
    if cnt[0] == 0 and len(cnt) == 1:
        ans = "Yes"
    else:
        ans = "No"
print(ans)
D = int(input())
N = 26
c = [int(i) for i in input().split()]
last = [0 for i in range(N)]
bias = 1.5

for i in range(D):
  s_d = [int(j) for j in input().split()]
  d_score = -1
  ans = -1
  for j in range(N):
    last_day = (i + 1 - last[j])*bias
    arg = s_d[j] + c[j]*last_day
    if d_score < arg:
      d_score = arg
      ans = j+1
  print(ans)
  
  test += s_d[ans-1]
  last[ans-1] = i+1

### FIXED CODE ###

D = int(input())
N = 26
c = [int(i) for i in input().split()]
last = [0 for i in range(N)]

for i in range(D):
  s_d = [int(j) for j in input().split()]
  d_score = -1
  ans = -1
  for j in range(N):
    last_day = i + 1 - last[j]
    arg = s_d[j] - c[j]*last_day
    if d_score < arg:
      d_score = arg
      ans = j+1
  print(ans)
  last[ans-1] = i+1
n, k = map(int, input().split())
n_list = [1]*n
for _ in range(k):
  _ = input()
  for i in range(list(map(int, input().split()))):
    n_list[i-1] = 0
print(sum(n_list))


### FIXED CODE ###

n, k = map(int, input().split())
n_list = [1]*n
for _ in range(k):
  _ = input()
  for i in list(map(int, input().split())):
    n_list[i-1] = 0
print(sum(n_list))
a,b,c = int(iput().split())
if b + a - c > 0:
	print(b+c)
else:
	print(a+2*b+1)

### FIXED CODE ###

a,b,c = map(int,input().split())
if b + a - c + 1 >= 0:
	print(b+c)
else:
	print(a+2*b+1)
Jupyter Notebook
200621 Current Kernel Logo

Python 3

    File
    Edit
    View
    Insert
    Cell
    Kernel
    Help

1

import sys

2

#sys.exit()

3

#sorted( ,reverse=True)

4

#N = int(input())

5

#S,T = map(int, input().split())

6

#A = list(map(int, input().split()))

7

#A = [int(input()) for _ in range(N)]

8

​

9

#cnt = 0

10

#cnt += 1

11

​

12

​

13

​

14

#print(N)

15

#print(S,T)

16

#print(A)

17

#print('Yes')

18

#print('No')

19

#print(cnt)

3
3
4
5
3
[3, 4, 5]

1

import sys

2

#sys.exit()

3

#sorted( ,reverse=True)

4

#N = int(input())

5

#S,T = map(int, input().split())

6

#A = list(map(int, input().split()))

7

#A = [int(input()) for _ in range(N)]

8

​

9

#cnt = 0

10

#cnt += 1

11

​

12

​

13

​

14

#print(N)

15

#print(S,T)

16

#print(A)

17

#print('Yes')

18

#print('No')

19

#print(cnt)

20

​

21

S = str(input())

22

A = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U","V","W","X","Y","Z"]

23

​

24

if S in A:

25

    print('A')

26

else:

27

    print('a')

a
a

1

​



### FIXED CODE ###

import sys
#sys.exit()
#sorted( ,reverse=True)
#N = int(input())
#S,T = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]

#cnt = 0
#cnt += 1



#print(N)
#print(S,T)
#print(A)
#print('Yes')
#print('No')
#print(cnt)

S = str(input())
A = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U","V","W","X","Y","Z"]

if S in A:
    print('A')
else:
    print('a')
n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]

mem = [k - len(a)] * n
for i in range(len(a)):
    mem[a[i]] += 1

for i in range(n):
    if mem[i] > 0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]

mem = [k - len(a)] * n
for i in range(len(a)):
    mem[a[i]-1] += 1

for i in range(n):
    if mem[i] > 0:
        print('Yes')
    else:
        print('No')
#####segfunc#####
def segfunc(x, y):
    return min(x, y)
#################
 
#####ide_ele#####
ide_ele = 10**9
#################
 
class SegTree:
    """
    init(init_val, ide_ele): 配列init_valで初期化 O(N)
    update(k, x): k番目の値をxに更新 O(logN)
    query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
    """
    def __init__(self, init_val, segfunc, ide_ele):
        """
        init_val: 配列の初期値
        segfunc: 区間にしたい操作
        ide_ele: 単位元
        n: 要素数
        num: n以上の最小の2のべき乗
        tree: セグメント木(1-index)
        """
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        # 配列の値を葉にセット
        for i in range(n):
            self.tree[self.num + i] = init_val[i]
        # 構築していく
        for i in range(self.num - 1, 0, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])
 
    def update(self, k, x):
        """
        k番目の値をxに更新
        k: index(0-index)
        x: update value
        """
        k += self.num
        self.tree[k] = x
        while k > 1:
            self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
            k >>= 1
 
    def query(self, l, r):
        """
        [l, r)のsegfuncしたものを得る
        l: index(0-index)
        r: index(0-index)
        """
        res = self.ide_ele
 
        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                res = self.segfunc(res, self.tree[l])
                l += 1
            if r & 1:
                res = self.segfunc(res, self.tree[r - 1])
            l >>= 1
            r >>= 1
        return res


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



ans = (N-2)**2
yoko = [N-2 for _ in range(N-2)]
tate = [N-2 for _ in range(N-2)] 
yoko = SegTree(yoko, segfunc, ide_ele)
tate = SegTree(tate, segfunc, ide_ele)
miny = N-2
minx = N-2
for k in range(Q):
	n, x = map(int, input().split())
	if n == 1:
		y = x -2
		if y < miny:
			ans -= minx
			miny = y
			yoko.update(min(minx, N-3), miny)
		else:
			ans -= tate.query(y, N-1)
	else:
		x = x - 2
		if x < minx:
			ans -= miny
			minx = x
			tate.update(min(miny, N-3), minx)
		else:
			ans -= yoko.query(x, N-1)
print(ans)


### FIXED CODE ###

S = input()
if S[-1] != 's':
	print(S + 's')
else:
	print(S+'es')
lis=input().split()
a=int(lis[0])
b=int(lis[1])
if a=1:
    if b=1:
        print(Draw)
    else :
        print(Alice)
elif b=1:
    print(Bob)
else :
    if a>b:
        print(Alice)
    elif a=b:
        print(Draw)
    else :
        print(Bob)

### FIXED CODE ###

lis=input().split()
a=int(lis[0])
b=int(lis[1])
if a==1:
    if b==1:
        print("Draw")
    else :
        print("Alice")
elif b==1:
    print("Bob")
else :
    if a>b:
        print("Alice")
    elif a==b:
        print("Draw")
    else :
        print("Bob")
a,b,k=map(int,input().split());n=[*range(a,b+1)]
try:
  n=sorted(set(n[:k]+n[-k:]));print(*n,sep='\n')
except:
  print(*n,sep='\n')

### FIXED CODE ###

A,B,K = map(int, input().split())
[print(i) for i in sorted(list(set([i for i in range(A,A+K)] + [i for i in reversed(range(B-K+1, B+1))]))) if A <= i <= B]
A = int(input)
B = int(input)
C = int(input)
X = int(input)

if min(A, B, C, X) == X:
	print(0)

def num_patterns(A, B, C, X):
    if X == 0:
      	return 1
	if min(A, B, C, X) == X:
    	return 0
    branch_A = num_patterns(A - 1, B    , C    , X - 500) if A > 0 else 0
    branch_B = num_patterns(A    , B - 1, C    , X - 100) if B > 0 else 0
    branch_C = num_patterns(A    , B    , C - 1, X - 50) if C > 0 else 0
    return branch_A + branch_B + branch_C

print(num_patterns(A, B, C, X))

### FIXED CODE ###

import functools

A = int(input())
B = int(input())
C = int(input())
X = int(input())

if min(A, B, C, X) == X:
	print(0)

@functools.lru_cache(1000)
def num_patterns(A, B, C, X):
    if X == 0:
      	return 1

    if min(A, B, C, X) == X:
        return 0

    if A > 0:
        return sum(
            num_patterns(0, B, C, X - 500 * nA) if X >= 500 * nA else 0
            for nA in range(0, A + 1)
        )
    if B > 0:
        return sum(
            num_patterns(0, 0, C, X - 100 * nB) if X >= 100 * nB else 0
            for nB in range(0, B + 1)
        )
    if C > 0 and X % 50 == 0 and X / 50 <= C:
        return 1
    else:
        return 0

print(num_patterns(A, B, C, X))
x,a,b=map(int,input().split())
if b>a and b-a<x:
	print("safe")
elif b=a and b-a=X
	print("delicious")
elif b<a and a-b<x:
	print("delicious")
else:
	print("dangerous")
	


### FIXED CODE ###

x,a,b=map(int,input().split())
if b>a and b-a<=x:
	print("safe")
elif b<=a and a-b<=x:
	print("delicious")
else:
	print("dangerous")
h, w = map(int,input().split())
c = [list(map(int,input().split())) for i in range(10)]
a = [list(map(int,input().split())) for i in range(h)]

'''重み0の辺は自動で消されてしまうので注意'''
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
inf = 10 ** 10
G = csgraph_from_dense(c, null_value = 0)
d = floyd_warshall(G)
cost = 0

for i in range(h):
    for j in range(w):
        temp = a[i][j]
        if temp == -1:continue
        cost += d[temp][1]
print(int(cost))

### FIXED CODE ###

h, w = map(int,input().split())
c = [list(map(int,input().split())) for i in range(10)]
a = [list(map(int,input().split())) for i in range(h)]

for k in range(10):
    for i in range(10):
        for j in range(10):
            if i == j:continue
            c[i][j] = min(c[i][j], c[i][k] + c[k][j])

cost = 0
for i in range(h):
    for j in range(w):
        temp = a[i][j]
        if temp == -1:continue
        cost += c[temp][1]
print(cost)
n = int(input())
a = input().split(" ")
lista = [int(n) for n in a]
if 0 in lista:
  print(0)
  exit()
kotae=1
for i in range(n+1):
  kotae=kotae*lista[i]
  if kotae>10**18:
    print(-1)
    exit()
print(kotae)


### FIXED CODE ###

n = int(input())
a = input().split(" ")
kotae=1
listaa = [int(n) for n in a]
lista = sorted(listaa)
if lista[0]==0:
  print(0)
  exit()
for i in range(n):
  kotae*=lista[i]
  if kotae>10**18:
    kotae=-1
    break
if kotae>10**18:
  kotae=-1
print(kotae)
SA = list(input())
SB = list(input())
SC = list(input())

x = "a"

while True:
  if x == "a":
    if len(SA) ==0:
      print("A")
      exit()

    x = SA[0]
    SA.remove(x)
  
  elif x == "b":
    if len(SB) ==0:
      print("B")
      exit()

    x = SB[0]
    SB.remove(x)

  else:
    if len(SB) == 0:
      print("C")
      exit()
    
    x = SC[0]
    SC.remove(x)


### FIXED CODE ###

SA = list(input())
SB = list(input())
SC = list(input())

x = "a"

while True:
  if x == "a":
    if len(SA) ==0:
      print("A")
      exit()

    x = SA[0]
    SA.remove(x)
  
  elif x == "b":
    if len(SB) ==0:
      print("B")
      exit()

    x = SB[0]
    SB.remove(x)

  else:
    if len(SC) == 0:
      print("C")
      exit()
    
    x = SC[0]
    SC.remove(x)
# coding: utf-8

# In[46]:


def main():
    N,M = map(int, input().split())
    A = list(map(int, input().split()))
    
    match = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    
    result = [-1 for _ in range(N+1)]
    result[0] = 0
    
    print(result)
    
    for i in range(1, N+1):
        for a in A:
            if i < match[a]:
                print(i,a,result)
                continue
            result[i] = max(result[i], result[i-match[a]]*10+a)
            print(i,a,result)
    
    print(result[N])


# In[47]:


main()



### FIXED CODE ###


# coding: utf-8

# In[1]:


def main():
    N,M = map(int, input().split())
    A = list(map(int, input().split()))
    
    match = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    
    result = [-1 for _ in range(N+1)]
    result[0] = 0
    
    #print(result)
    
    for i in range(1, N+1):
        for a in A:
            if i < match[a]:
                #print(i,a,result)
                continue
            result[i] = max(result[i], result[i-match[a]]*10+a)
            #print(i,a,result)
    
    print(result[N])


# In[2]:


main()
from heapq import heappush, heappop
import collections
import math
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


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

    E = {}
    for i in range(0, N+1):
        E[i] = []
    for i in range(N-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        E[a].append(b)
        E[b].append(a)

    dp = [[0 for i in range(2)] for j in range(100100)]


    def dfs(c, p):
        dp[c][0], dp[c][1] = 1, 1
        for to in E[c]:
            if to != p:
                dfs(to, c)
                dp[c][0] *= dp[to][0] + dp[to][1]
                dp[c][1] *= dp[to][0]


    dfs(0, -1)

    ans = (dp[0][0] + dp[0][1]) % MOD
    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from heapq import heappush, heappop
import collections
import math
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


def main():
    N = int(input())
    E = {}
    for i in range(0, N+1):
        E[i] = []
    for i in range(N-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        E[a].append(b)
        E[b].append(a)

    dp = [[0 for i in range(2)] for j in range(100100)]

    def dfs(c, p):
        dp[c][0], dp[c][1] = 1, 1
        for to in E[c]:
            if to != p:
                dfs(to, c)
                dp[c][0] *= dp[to][0] + dp[to][1]
                dp[c][1] *= dp[to][0]

    dfs(0, -1)

    ans = (dp[0][0] + dp[0][1]) % MOD
    print(ans)


if __name__ == '__main__':
    main()
N = int(input())
num_lists = list(map(int, input().split))
max_num = max(num_lists)
min_num = min(num_lists)
ans = max_num - min_num
print(ans)

### FIXED CODE ###

N = int(input())
num_lists = list(map(int, input().split()))
max_num = max(num_lists)
min_num = min(num_lists)
ans = max_num - min_num
print(ans)
A = input()
B = input()

A = int(A)
B = int(B)

if A > B:
  print(B)
else:
  print(0)

### FIXED CODE ###

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

if A > 2*B:
  print(A-2*B)
else:
  print(0)
x * 3

### FIXED CODE ###

x = int(input())
print(x ** 3)
A = int(input())
B = int(input())
if A >= 0 and  A <= 5:
    print(0)
if A >= 6  and A <= 12:
    print(B//2)
if A >= 13 and A <= 100:
    print(B)

### FIXED CODE ###

line = input()
a, b = [int(n) for n in line.split()]
if a>=13:
    print(b)
elif a>=6:
    b = b/2
    b = int(b)
    print(b)
else:
    print("0")
n = int(input())

info = []
for i in range(n):
    pre = list(map(int,input().split(" ")))
    info.append(pre)
    
end = 0
if n >=3:
    for x in range(101):
        for y in range(101):
            H = info[0][2] + abs(x-info[0][0]) + abs(y-info[0][1])
            if H <= 10**9
                for i in range(1,n):
                    if info[i][2] != H - abs(x-info[i][0]) - abs(y- info[i][1]):
                        break
                else:
                    print(x,y,H)
                    end = 1
                
                if end == 1:
                    break
            if end == 1:
                break
elif n ==2:
    info = sorted(info, key = lambda x:x[2])
    if info[0][0] > info[1][0]:
        h = info[1][2] + info[1][0]
        x = 0
    else:
        h = info[1][2] + 100- info[1][0]
        x = 100
    if info[0][1] > info[1][1]:
        h += info[1][1]
        y = 0
    else:
        h += 100 - info[1][1]
        y =100
    ans = list(map(str,(x,y,h)))
    print(" ".join(ans))

### FIXED CODE ###

n = int(input())

info = []
for i in range(n):
    pre = list(map(int,input().split(" ")))
    info.append(pre)

info = sorted(info,key = lambda x: x[2])
end = 0

for x in range(101):
    for y in range(101):
        H = info[n-1][2] + abs(x-info[n-1][0]) + abs(y-info[n-1][1])
        for i in range(n-1):
            if info[i][2] != max(0,H - abs(x-info[i][0]) - abs(y- info[i][1])):
                break
        else:
            print(x,y,H)
            end = 1
            
        if end == 1:
            break
    if end == 1:
        break
import 
S = input()
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")


### FIXED CODE ###

S = input()
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
from collections import Counter
import bisect

def sortedexist(list,x):
    if bisect.bisect_left == bisect.bisect_right:
        return False
    else:
        return True

N = int(input())
A = [int(hoge) for hoge in input().split()]
C = Counter(A)
A.sort()
done = dict()
for a in A:
    done[a] = False
dp = [False] * 10**6 + 1

for a in A:
    if done[a]:
        dp[a] = True
    else:
        for j in range(2,10**6 // a):
            dp[a*j] = True
        done[a] = True
print(sum([dp[a] == False for a in A ]))

### FIXED CODE ###

N = int(input())
A = [int(hoge) for hoge in input().split()]
A.sort()
M = max(A)
dp = [False] * (M+ 1)
ans = 0
prev = -1
for a in A:
    if dp[a] == False:
        for j in range(2,1 + (M// a)):
            dp[a*j] = True
        if a != prev:
            ans += 1
        else:
            dp[a] = True
            ans -= 1
    prev = a
print(ans)
import numpy as np
N=int(input())
A=list(map(int,input().split()))
B=[A[i]-i-1 for i in range(N)]
B.sort()
if N%2==0:
    b=B[N//2]
else:
    b=(B[N//2-1]+B[N//2])//2
print(int(sum([abs(Bb-b) for Bb in B])))


### FIXED CODE ###

N=int(input())
if N%2==0:
    print(N)
else:
    print(2*N)
n,k= map(int,input().split())
if n < k:
    print(n % k)
else:

    print(k%(abs(n) % abs(k)))

### FIXED CODE ###

n,k= map(int,input().split())
if n % k == 0:
    print("0")
elif n < k:
    print(min(n % k,abs(n % k - k)))
else:
    print(min(n % k,abs(n % k - k)))
import numpy as np

N = int(input())
p = [int(x) for x in input().split(" ")]

sorted_p = sorted(p)
count = 0
for i in range(N):
    if sorted_p[i] != p[i]: count += 1

if count == 0 or count == 2:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

import numpy

A, B = [int(x) for x in input().split(" ")]
if (A - B) % 2 == 0:
    print(abs(A + B) // 2)
else:
    print("IMPOSSIBLE")
a = int(input())
b = 0
count = 0
for i in range(9):
  for j in range(9):
    if (i+1)*(j+1) == a:
      count += 1
      if count>0:
        if (c+d)>(i+1)+(j+1):
		  c = i+1
          d = j+1
      else :
        c = i+1
        d = j+1
ans = c+d-2
print(ans)

### FIXED CODE ###

a = int(input())
b = 0
l = int(a**0.5)+1
count = 0
for i in range(l):
    i = i+1
    if a%i == 0:
        j = a//i
    if i*j == a:
        if count == 0:
            count += 1
            c = i
            d = j
        if count>0:
            if (c+d)>(i+j):
                c = i
                d = j
ans = c+d-2
print(ans)
N,K = map(int,input().split())
x = list(map(int,input().split()))
ans = float('inf')
if(0 in x):
    K=K-1
    x.remove(0)
for i in range(0,N-K):
    if((x[i]<0)):
        if(x[i+K-1]>0):
            ans = min(ans,abs(x[i])*2+x[i+K-1],abs(x[i])+x[i+K-1]*2)
        else:
            ans = min(ans,abs(x[i])*2)
    else:
            ans = min(ans,x[i+K-1])
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
x = list(map(int,input().split()))
ans = float('inf')
if(0 in x):
    K=K-1
    x.remove(0)
    if(K==0):
        print(0)
        exit()
for i in range(0,N-K+1):
    if((x[i]<0)):
        if(x[i+K-1]>0):
            ans = min(ans,abs(x[i])*2+x[i+K-1],abs(x[i])+x[i+K-1]*2)
        else:
            ans = min(ans,abs(x[i]))
    else:
            ans = min(ans,x[i+K-1])
print(ans)
n = int(input())
s = input()

k = 0

for i in range(n-2):
	if s[i] == A and s[i+1] == B and s[i+2] == C:
		k += 1
        
print(k)


### FIXED CODE ###

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

k = 0

for i in range(n-2):
	if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
		k += 1
        
print(k)