peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import collections
 
n = int(input())
lens = list(map(int,input().split()))
lens = collections.Counter(lens)
lens = sorted(lens.items(), key=lambda x:x[0], reverse = True)
cnt = 0
for j in lens:
  if j[1] >= 4 and cnt == 0:
    print(j[0]**2)
    break
  elif j[1] >= 2 and cnt == 0:
    cnt = j[0]
  elif j[1] >= 2 and cnt != 0:
    print(cnt * j[0])
    break
else:
    print(0)
# Judge status: Accepted
n,m = [int(i) for i in input().split()]
p = ['P']*n
k = ['I']*m
al = p+k
ans = 0
for i in range(len(al)):
    for j in range(i+1,len(al)):
        if al[i] == 'I' and al[j]=='I':ans+=1
        if al[i] == 'P' and al[j] == 'P': ans+=1
print(ans)
# Judge status: Accepted
l=("Sunny", "Cloudy", "Rainy", "Sunny")
print(l[l.index(input())+1])
# Judge status: Accepted
import collections

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

B = []
cnt = 0
for i in range(N):
    if A[i] >= 3200:
        cnt += 1
    else:
        B.append(A[i]//400)

c = collections.Counter(B)

small = len(c) if len(c) != 0 else 1
big = len(c)+cnt

print(small, big)
# Judge status: Accepted
import math

num = 1
for i in range(int(input())):
    a = int(input())
    cnt = math.gcd(a, num)
    num = (a * num) // cnt
print(num)
# Judge status: Wrong Answer
n=int(input())
l=list(map(int,input().split()))

if max(l)*2 >sum(l):
  print("No")
  exit()
print("Yes")
# Judge status: Accepted
s=list(input())

a=s.count("a")
b=s.count("b")
c=len(s)-a-b

M=max(a, b, c)-min(a, b, c)

if M<=1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
s = input()
ans = True
if s[0]!='A':
    ans = False
if s[2:-1].count('C')!=1:
    ans = False
upper = 0
for i in  s:
    if i.isupper():
        upper += 1

if upper != 2:
    ans = False

if ans:
    print('AC')
else:
    print('WA')
# Judge status: Accepted
S,T = input(),input()

d = [None]*26
flag = True
for s,t in zip(S,T):
    s = ord(s)-ord('a')
    t = ord(t)-ord('a')
    if d[s] is None:
        d[s] = t
    elif d[s] != t:
        flag = False
        break

if not flag:
    print('No')
elif len(set(v for v in d if v is not None)) != sum(int(v is not None) for v in d):
    print('No')
else:
    print('Yes')
# Judge status: Accepted
N, A, B = map(int,input().split())

result = 0
for n in range(1,N+1):
    sm = 0
    for i in range(len(str(n))):
        sm += int(str(n)[i])
    if A<=sm<=B:
        result += n

print(result)
# Judge status: Accepted
from math import log2
h = int(input())
print((1 << int((log2(2 * h + 1)))) - 1)
# Judge status: Accepted
N = int(input())
lst = list(map(int, input().split()))
alice = []
bob = []
lst.sort(reverse=True)
for i in range(N):
    if i%2 == 0:
        alice.append(lst[i])
    else:
        bob.append(lst[i])

dif = sum(alice) - sum(bob)
print(dif)
# Judge status: Accepted
n=int(input())
a = n//(10**9)+1
b = 10**9-(n%(10**9))
if n%(10**9) == 0:
  print(0,0,10**9,0,1,a-1)
else:
  print(0,0,10**9,b,1,a)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x, y, z = map(int, readline().split())
q = x // (y + z)
r = x % (y + z)
ans = q if z <= r else q - 1
print(ans)
# Judge status: Accepted
h,n = map(int, input().split( ))
m = []
mxa = 0
for _ in range(n):
    ai,bi = map(int, input().split( ))
    m.append((ai,bi))
    mxa = max(mxa,ai)
inf = 10**10
dp = [inf for _ in range(h+1+mxa)]
dp[0] = 0
for i in range(h+mxa):
    for j in range(n):
        if i+m[j][0]<=h+mxa:
            dp[i+m[j][0]] = min(dp[i+m[j][0]],dp[i]+m[j][1])
print(min(dp[h:]))
# Judge status: Accepted
a = []
for _ in range(3):
  a += [int(i) for i in input().split()]

n = int(input())

ans = []
for _ in range(3):
  ans += [0]*3
  
for _ in range(n):
  b = int(input())
  if b in a:
    ans[a.index(b)] = 1
    
f = False
for i in range(3):
  if sum(ans[3*i:3*i+3]) == 3:
    f = True

for i in range(3):
  if sum(ans[i::3]) == 3:
    f = True
    
if (ans[0] + ans[4] + ans[8]) == 3:
  f = True
if (ans[2] + ans[4] + ans[6]) == 3:
  f = True
  
if f:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

for _ in range(min(k, 100)):
    new_a = [0]*n
    for i in range(n):
        d = a[i]
        new_a[max(i-d, 0)] += 1
        if i+d+1 <= n-1:
            new_a[i+d+1] -= 1
    for i in range(n-1):
        new_a[i+1] += new_a[i]

    a = new_a

print(*a)
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  if p[i-1]<p[i] and p[i]<p[i+1]:
    ans+=1
  if p[i+1]<p[i] and p[i]<p[i-1]:
    ans+=1
print(ans)
# Judge status: Wrong Answer
w, h , n = map(int, input().split())
x1,y1, x2,y2=0 , 0 , w, h
for i in range(0,n):
	x , y, a = map(int , input().split())
	if a==1:
		x1 = x
	elif a==2:
		x2=x
	elif a==3:
		y1=y
	else:
		y2=y
ar=(y2-y1)*(x2-x1)
if ar<=0:
	print(0)
else:
	print(ar)
# Judge status: Accepted
N = int(input())
S = str(input())
R, G, B = 0, 0, 0
for i in range(N):
  if S[i] == "R":
    R += 1
  elif S[i] == "G":
    G += 1
  else:
    B += 1
    
ans = R * G * B 

for i in range(1, 2000):
  for j in range(1, N - 2 * i + 1):
    if S[j - 1] != S[j + i - 1]:
      if S[j + 2 * i - 1] != S[j + i - 1]:
        if S[j - 1] != S[j + 2 * i - 1]:
          ans -= 1
            
print(max(ans, 0))
# Judge status: Accepted
N,K=map(int,input().split())
*X,=map(int,input().split())
i=0
ans=[]
while i+K-1<N:
    a,b=X[i],X[i+K-1]
    if b<0:
        ans.append(abs(a))
    elif a>0:
        ans.append(b)
    else:
        a=abs(a)
        ans.append(a+b+min(a,b))
    i+=1
print(min(ans))
# Judge status: Accepted
n,x,y = map(int, input().split())
t = [0 for i in range(n)]
x = x-1
y = y-1
for i in range(0,n):
  for j in range(i,n):
    a = abs(i-x)+abs(j-y)+1
    b = abs(i-j)
    if a < b:
      t[a-1] += 1
    else:
      t[b-1] += 1

for k in range(0,n-1):
  print(int(t[k]))
# Judge status: Wrong Answer
n,k = list(map(int,input().split(' ')))
h = list(map(int, input().split(' ')))

dp = [0]*n 

for i in range(1,n):
    temp = 1000000
    for j in range(1,k+1):
        if i-j>=0:
            temp = min(dp[i-j]+abs(h[i]-h[i-j]), temp)
    
    dp[i] = temp
    
print(dp[-1])
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[list(map(int,input().split())) for a in range(n)]
c=[list(map(int,input().split())) for b in range(m)]
dist=0
minnum=0
for indi,i in enumerate(a):
    min=10*10
    minnum=0
    for indj,j in enumerate(c):
        dist=0 
        dist+=abs(i[0]-j[0])
        dist+=abs(i[1]-j[1])
        #print("dist={}".format(dist))
        if min>dist:
            min=dist
            minnum=indj
    print(minnum+1)
# Judge status: Accepted
N,a,b=map(int, input().split())
if a>b:
  print(0)
elif a<b and N==1:
  print(0)
else:
  print(b*(N-2)-a*(N-2)+1)
# Judge status: Accepted
import itertools

N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for i in range(Q)]

array = list(itertools.combinations_with_replacement(range(1, M + 1), N))

maxScore = 0
for x in array:
    score = 0
    for y in abcd:
        if x[y[1] - 1] - x[y[0] - 1] == y[2]:
            score += y[3]
    maxScore = max(maxScore, score)
print(maxScore)
# Judge status: Wrong Answer
n=int(input())

sm=0
work=7
for i in range(1,n):
    sm+=work
    if sm==n :
        print(i)
        break
    elif sm>n :
        sm-=n    
    work*=10
    work%=n

else : print(-1)
# Judge status: Accepted
N,D=map(int,input().split())
X=[list(map(int,input().split())) for _ in range(N)]
ans=0
for i in range(N):
    for j in range(i+1,N):
        d=0
        for k in range(D):
            d+=(X[i][k]-X[j][k])**2
        for l in range(1000):
            if l**2==d:
                ans+=1
                break
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())

def fib(n):
    if n == 0:
        return 0
    one = 1
    two = 1
    for _ in range(n-2):
        two,one = one + two,two
    return two

ans,now = 1,0
for i in range(M):
    a = int(input())
    ans *= fib(a - now)
    now = a+1
    if ans > 10**9+7:
        ans %= 10**9 + 7
ans *= fib(N - now + 1)
ans %= 10**9 + 7

print(ans)
# Judge status: Accepted
X , Y, Z =map(int,input().split())
print(X*Y//2)
# Judge status: Accepted
a, b, c, x, y = (int(x) for x in input().split())
ans = 10**18
ans = min(ans, a * x + b * y)
z = min(x, y)
ans = min(ans, 2 * c * z + a * (x - z) + b * (y - z))
ans = min(ans, 2 * c * max(x, y))
print(ans)
# Judge status: Accepted
N = int(input())
As = list(map(int, input().split()))
 
sum_humidai = 0
max_front_person = 0
  
for person_idx, person_height in enumerate(As):
  
  if person_idx == 0:
    continue
    
  max_front_person = max(max_front_person, As[person_idx - 1])
  if max_front_person > person_height:
    humidai = max_front_person - person_height
    sum_humidai += humidai
 
print(sum_humidai)
# Judge status: Accepted
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
c = [[] for _ in range(m)]
for i in range(m):
    c[i] = list(map(int, input().split()))
a.sort()
c.sort(key=lambda x: x[1], reverse=True)
ans = sum(a)
sa = 0
cnt = 0
r = c[0][0]
for i, v in enumerate(a):
    if r <= i and cnt <= m - 2:
        cnt += 1
        r += c[cnt][0]
    if r > i and v < c[cnt][1]:
        ans += abs(c[cnt][1] - v)
    else:
        break
print(ans)
# Judge status: Wrong Answer
n = int(input())
list = map(int,input().split())

list2=[]
for i in list:
    if i%2==0:
        list2.append(i)

if list2:
    if all(i%3==0 or i%5==0 for i in list2):
        print('APPROVED')
    else:
        print('DENIED')
else:
    print('DENIED')
# Judge status: Accepted
a,b,c=map(int,input().split())
print("Yes"if a<=c<=b else"No")
# Judge status: Accepted
s=input()
t=input()
for i in range(1,len(s)+1):
  if t==s[-i:]+s[:-i]:
    print('Yes')
    exit()
print('No')
# Judge status: Accepted
s=input()
count=0
count1=0
for i in s:
    if i=='R':
        count+=1
        if count1<count:
            count1=count
    else:
        count=0
print(count1)
# Judge status: Accepted
n = int(input())
s = input()
nw = len([i for i in s if(i == 'W')])
ns = n - nw
i = 0
j = n-1
c = 0
while(i < j):
	if(s[i] == 'W' and s[j] == 'R'):
		c += 1
		i += 1
		j -= 1
	elif s[i] == 'R':
		i += 1
	elif s[j] == 'W':
		j -= 1
print(min([c,nw, ns]))
# Judge status: Accepted
x = int(input())
OP = [+1, -1]
for a in range(1000):
    for b in range(a + 1):
        for op1 in OP:
            for op2 in OP:
                if (op1 * a)**5 - (op2 * b)**5 == x:
                    print(op1 * a, op2 * b)
                    exit()
# Judge status: Accepted
n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
s=list(input())

x=0
mx=0

for si in s:
    if si=='I':
        x+=1
    else:
        x-=1
    mx=max(x,mx)
print(mx)
# Judge status: Accepted
import sys
input = sys.stdin.readline

a, b, c = map(int, input().split())
check = c - a - b
if check ** 2 > 4 * a * b and check > 0:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
# Judge status: Accepted
D,T,S=map(int,input().split())
if D/S<=T :
  print("Yes")
else :
  print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())
if a<c and c<b:
  print("Yes")
elif b<c and c<a:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
seq=input()

s=0
t=0
c=0

for si in seq:
    if si=="S":
        s+=1
    else:
        if s==0:
            c+=1
        else:
            s-=1
c+=s

print(c)
# Judge status: Accepted
R=int(input())
print (R*2*3.14159265358979)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
sm=sum(a)
i=0
han=0

while sm/2>sum(a[:i+1]):
  i+=1
i-=1
print(abs(2*sum(a[:i+1])-sm))
# Judge status: Accepted
n,k,s = map(int,input().split())

PAD = 10**9
ans = []
if s==PAD:
  PAD = 1
for i in range(k):
  ans.append(s)
for i in range(n-k):
  ans.append(PAD)  
  
print(*ans)
# Judge status: Accepted
N=int(input())
H=list(map(int,input().split()))
base=0
for h in H:
    if base>h:
        print("No")
        break
    base=max(base,h-1)
else:
    print("Yes")
# Judge status: Accepted
D,N=map(int,input().split())
A=100**D
ans=N*A
if N==100:
    ans=101*A
print(ans)
# Judge status: Accepted
import itertools
s = input()
ans = len(s)
a = 0
for key,group in itertools.groupby(s):
  b = len(list(group))
  if key=="S":
    a += b
  elif key=="T":
    if a<=b:
      ans -= a*2
      a = 0
    else:
      ans -= b*2
      a = a-b
print(ans)
# Judge status: Wrong Answer
import math
x = int(input())
for i in range(0, x):
    b = int(i**5 - x)
    if b > 0:
        b = b**0.2
    else:
        b = -((-b)**0.2)
    try:
        if b % 1 == 0:
            print(i, int(b))
            break
    except:
        pass
# Judge status: Wrong Answer
s = str(input())
n = int(input())
k = ord("z")
a = [0]*len(s)
for i in range(len(s)):
    a[i] = ord(s[i])
for i in range(len(s)):
    if n>=k+1-a[i]:
        n = n-k-1+a[i]
        a[i] = ord("a")
    
    if n<=0:
        break
if n>0:
    a[-1] += n%26
ans = ""
for i in range(len(s)):
    ans += chr(a[i])
print(ans)
# Judge status: Accepted
k = int(input())
a, b = map(int, input().split())
p = a % k
q = k - p
if (p == 0) or ((a + q) <= b):
    print('OK')
else:
    print('NG')
# Judge status: Wrong Answer
import collections
import numpy as np
n = int(input())
S = [[0] * 2 * 10 * 5] * n
l = []

for i in range(n):
    S[i] = input()

c = collections.Counter(S)
tmp = c[max(c)]

for k,v in c.items():
    if tmp != v:
        break
    tmp = v
    l.append(k)

l = sorted(l)
for i in l:
    print(i)
# Judge status: Accepted
A = [ [int(x) for x in input().split()] for _ in range(3) ]
N = int(input())
B = set([ int(input()) for _ in range(N) ])
res = "No"
for i in range(3):
    c1 = 0
    c2 = 0
    for j in range(3):
        c1 += 1 if A[i][j] in B else 0
        c2 += 1 if A[j][i] in B else 0
    if c1==3 or c2==3:
        res = "Yes"
if sum([ 1 if A[j][j] in B else 0 for j in range(3) ]) == 3:
    res = "Yes"
if sum([ 1 if A[j][2-j] in B else 0 for j in range(3) ]) == 3:
    res = "Yes"
print(res)
# Judge status: Accepted
def readinput():
    n=int(input())
    return n

def main(n):
    fk=[1]*(n+1)
    for i in range(2,n+1):
        j=i
        while(j<=n):
            fk[j]+=1
            j+=i
    sum=0
    for i in range(1,n+1):
        sum+=i*fk[i]
    return sum

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)
# Judge status: Accepted
h1,m1,h2,m2,k=map(int,input().split())
t=0
if m2>m1:
    t=m2-m1+(h2-h1)*60-k
else:
    t=60+m2-m1+(h2-1-h1)*60-k
print(t)
# Judge status: Accepted
import math

N, K = [int(x) for x in input().split()]

S = 0
for i in range(1, N + 1):
    a = 0
    while i < K:
        a += 1
        i *= 2
    S += 0.5 ** a

ans = S / N
print(ans)
# Judge status: Accepted
import heapq

def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A = list(map(lambda x: x*(-1), A)) 
    heapq.heapify(A)
    ans = 0
    while M > 0:
        heapq.heappush(A, (heapq.heappop(A)*-1) // 2 * -1)
        M -= 1
    for i in range(N):
        ans += -A[i]
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import math
S=input()
N=len(S)
S1=S[0:math.floor((N-1)/2)]
S2=S[math.floor((N+3)/2)-1:N]
if S1==S1[::-1]:
  if S2==S2[::-1]:
    print('Yes')
  else:
    print('No')
else:
  print('No')
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
s = list(input())
t = list(input())

for i in range(n):
    if s[i:] == t[:n-i]:
        print(n+i)
        exit()


print(2*n)
# Judge status: Accepted
n,k = map(int,input().split())
a_list = list(map(int,input().split()))

used_dict = {}
used_list = []

current_node = 0

while True:
    if current_node not in used_dict:
        used_dict[current_node] = True
        used_list.append(current_node)
        current_node = a_list[current_node]-1
    else:
        break

repeat_index = used_list.index(current_node)
repeat_list = used_list[repeat_index:]
repeat_length = len(used_list) - repeat_index

if k > repeat_index:
    amari = (k-repeat_index) % repeat_length
    print(repeat_list[amari]+1)
else:
    print(used_list[k]+1)
# Judge status: Wrong Answer
import math
def main():
  a,b,k = list(map(int,input().split()))
  for i in range(a,b+1):
    if (i < a+k) or(b-k+1 < i):
      print(i)
  
main()
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
k = int(input())
c = c*2
if k > 1:
  for i in range(1,k):
    if b < c:
      b = b*2
    elif b > c:
      c = c*2
if a < b and b < c:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
p = [int(x) for x in input().split()]

ans = 0
for i in range(n-1):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1],p[i]
        ans += 1
if p[n-1] == n:
    ans += 1

print(ans)
# Judge status: Accepted
import math
n,m=map(int,input().split());r=10**9+7
if n==m: print(2*math.factorial(n)*math.factorial(m)%r)
elif abs(n-m)==1: print(math.factorial(n)*math.factorial(m)%r)
else: print(0)
# Judge status: Wrong Answer
import math
n = int(input())
l = ["".join(sorted(input())) for i in range(n)]
l.sort()
c = 0
b = l[0]
ans = 0
for s in l[1:]:
    if s == b:
        c += 1
    else:
        ans += c * (c + 1) * 0.5
        c = 0
    b = s
print(ans)
# Judge status: Wrong Answer
S=list(input())
S=['_']+S+['_']
i=0
count=0
while i<len(S)-2:
    count+=1
    if S[i]==S[i-1]:
        S[i+1]='_'
        i+=1
    i+=1
print(count)
# Judge status: Wrong Answer
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = sys.stdin.readline

def eprint(s):
    if type(s) != type('str'):
        s=str(s)

    sys.stderr.write(s+'\n')
    return

def main():
    s = input()
    print('x'*len(s))
    return

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

Num_str = list(input().rstrip())
L = len(Num_str)
Num = []
S = 0
for n in reversed(Num_str):
    Num.append(int(n))
    S += int(n)

up = False
for n in Num:
    if up:
        n += 1
    if n == 10:
        delta = -10
    else:
        delta = 1 + (10-n) - n
    if delta <= 0:
        up = True
        S += delta
    else:
        up = False

print(S)
# Judge status: Accepted
n = int(input())
t, a = map(int, input().split())
listh = list(map(int, input().split()))
diff = [abs((t-x*0.006)-a) for x in listh]
print(diff.index(min(diff))+1)
# Judge status: Accepted
import math
N,M=map(int,input().split())
A=list(map(int,input().split()))
sum=0
for i in range(M):
  sum+=A[i]
if sum>N:
  print("-1")
else:
  print(int(N-sum))
# Judge status: Accepted
N = int(input())
S = input()

if N % 2 == 0:
    if S[: N // 2] == S[N // 2:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Judge status: Accepted
from fractions import gcd
n, m = [int(i) for i in input().split()]
a = [int(i)//2 for i in input().split()]


def two(x):
    i = 0
    while x % 2 == 0:
        i += 1
        x //= 2
    return i


if two(min(a, key=two)) != two(max(a, key=two)):
    print(0)
else:
    lcm = 1
    for i in a:
        lcm = i * lcm // gcd(i, lcm)
        if lcm > m:
            print(0)
            break
    else:
        print((m+lcm)//(2*lcm))
# Judge status: Wrong Answer
N,A,B = map(int,input().split())
if (B-A)%2==0:
    print((B-A)//2)
else:
    print(min(N-A,B-1))
# Judge status: Accepted
S=input()
if S=='SAT':
    print(1)
if S=='MON':
    print(6)
if S=='TUE':
    print(5)
if S=='WED':
    print(4)
if S=='THU':
    print(3)
if S=='FRI':
    print(2)
if S=='SUN':
    print(7)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
while len(A)>=2: 
    X = float((A[0]+A[1])/2)
    A.pop(0)
    A.pop(0)
    A.append(X)
    A.sort()
else:
    print(*A)
# Judge status: Accepted
n, t_th = map(int, input().split())
c_min = 10000
for i in range(n):
    c, t = map(int, input().split())
    if t <= t_th and c < c_min:
        c_min = c
if c_min == 10000:
    print('TLE')
else:
    print(c_min)
# Judge status: Accepted
s=input()
l=list(map(int,s.split("/")))
if l[0] <=2018 or l[0] ==2019 and (l[1]<=3 or l[1] ==4 and l[2]<=30):
    print('Heisei')
else:
    print("TBD")
# Judge status: Accepted
def solve():
    k = int(input())
    print((k//2) * ((k+1)//2))

if __name__ == '__main__':
    solve()
# Judge status: Accepted
def main():
 n,k = map(int,input().split())
 if n % k == 0:
     print(0)
 else:
     print(1)
main()
# Judge status: Wrong Answer
n = int(input())
lis = []
for _ in range(n):
  x, l= list(input().split(" "))
  p_d = int(x) + int(l)
  m_d = int(x) - int(l)
  lis.append([m_d, p_d])

lis.sort()
a = -10 ** 10
x = 0

for b in range(n):
  if lis[b][0] >= a:
    x += 1
    a = lis[b][1]

print(x)
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    ans = "NO"
else:
    if abs(A - B) / (V - W) <= T:
        ans = "YES"
    else:
        ans = "NO"
print(ans)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
print(sum(sorted(a)[N::2]))
# Judge status: Accepted
N, A, B = map(int, input().split())

if (N == 1 and A != B) or (B < A):
    print(0)
else:
    print((B - A) * (N - 2) + 1)
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())

m = A - B

if (K % 2 == 0):
    print(m)
else:
    if (abs(m) > 10**18):
        print('Unfair')
    print(abs(m))
# Judge status: Accepted
import math
n=list(map(int,input().split()))
print(math.ceil(sum(n)/len(n)))
# Judge status: Wrong Answer
a, b, n = list(map(lambda x: int(x), input().split(' ')))

print((a * (n - 1)) // b - a * ((n - 1) // b))
# Judge status: Accepted
n = int(input())
total = 0
i = 1

while(n//pow(5, i)):
    if n%2 == 0:
        total += (n // pow(5, i)) // 2
    i += 1

print(total)
# Judge status: Accepted
n,m = map(int,input().split())
l = []
for i in range(m):
  a,b = map(int,input().split())
  l.append(a)
  l.append(b)
for i in range(1,n+1):
  print(l.count(i))
# Judge status: Accepted
n, m, x, y = [int(i) for i in input().split()]
x_list = [int(i) for i in input().split()] + [x]
y_list = [int(i) for i in input().split()] + [y]
print("No War" if max(x_list) < min(y_list) else "War")
# Judge status: Accepted
A, B = map(int, input().split())
done = False
for i in range(1, 1001):
    if A == (i *8 // 100) and B == (i * 10 // 100):
        print(i)
        done = True
        break

if not done:
        print(-1)
# Judge status: Accepted
import math
a, b, c = map(int,input().split())

if c-a-b < 0:
    print("No")
elif 4*a*b<(c-a-b)*(c-a-b):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
W,a,b=map(int,input().split())
l=a+W
r=b+W

a1=abs(l-b)
a2=abs(r-a)
if b<=l:
    if a<=r:
        print(0)
        exit()
ans=min(a1,a2)
print(ans)
# Judge status: Wrong Answer
s = [input() for i in range(5)]
x10 = int(0)
sum = int(0)
a = []

for i in range(5):
  if int(s[i]) % 10 == 0:
    x10 = x10 + 1
  else:
    pass
  sum = sum + ((int(s[i]) - 1) // 10 + 1) * 10
  a.append(int(s[i]) % 10)
  
b = [int(s) for s in a]

if x10 == 5:
  print(sum)
else:
  print(sum - 10 + min(b))
# Judge status: Accepted
n = int(input())
s = input()

x = 0
ans = 0
for i in s:
    if i == 'I':
        x += 1
        ans = max(ans, x)
    else:
        x -= 1
        
print(ans)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
count = 1
direction = 0
for a, b in zip(A, A[1:]):
	dif = b - a
	if direction == 0:
		if dif > 0:
			direction = 1
		elif dif < 0:
			direction = -1
	elif (direction == 1 and dif < 0) or (direction == -1 and dif > 0):
		count += 1
		direction = 0
print(count)
# Judge status: Accepted
n,m=map(int,input().split())
h=list(map(int,input().split()))
l=[[] for _ in range(n)]
for _ in range(m):
  a,b=map(int,input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)
ans=0
for i in range(n):
  f=1
  for j in l[i]:
    if h[i]<=h[j]:
      f=0
  if f:
    ans+=1
print(ans)