peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x, y, z = map(int,input().split())

print(z,x,y)
# Judge status: Wrong Answer
g = int(input())

grades = []
for i in range(g):
    grade = int(input())
    grades.append(grade)

total = sum(grades)
grades.sort()
grades = [0] + grades
for grade in grades:
    if (total - grade) % 10 != 0:
        print(total - grade)
        break


    
print(0)
# Judge status: Accepted
import math
H, W = list(map(int, input().split()))

sum = float(H*W)
if sum%2 == 0:
    if H == 1 or W == 1:
        print(1)
    else:
        print(H*W//2)
else:
    if H == 1 or W == 1:
        print(1)
    else:
        print(math.floor(H*W/2)+1)
# Judge status: Accepted
# https://atcoder.jp/contests/arc080/tasks/arc080_a
N = int(input())
A = list(map(int, input().split()))

# 2の倍数ならばどのように並んでてもよい
# 4の倍数ならば隣り合うものは2の倍数でなくともよい

multi4 = 0
multi2 = 0
other = 0
for a in A:
    if a % 4 == 0:
        multi4 += 1
    elif a % 2 == 0:
        multi2 += 1
    else:
        other += 1

if multi2 == 0:
    print('Yes' if other <= multi4 + 1 else 'No')
else:
    print('Yes' if other <= multi4 else 'No')
# Judge status: Wrong Answer
n=input()
l=sorted(n)
li=list(set(l))
li.sort()
la=[chr(ord('a') + i) for i in range(26)]
ans=""
for i in range(len(li)):
    if li[i]!=la[i]:
        ans=la[i]
        break
    else:
        pass

if ans=="":
  print("None")
else:
  print(ans)
# Judge status: Accepted
alp = ['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' ]
print(alp[alp.index(input())+1])
# Judge status: Accepted
import sys

s=list(input())

def f(p,i,F):
  if i == 4 and p == 7:
    print(F+"=7")
    sys.exit()
  elif i==4:
    return ""
  else:
    f(p+int(s[i]),i+1,F+"+"+s[i])
    f(p-int(s[i]),i+1,F+"-"+s[i])
    
f(int(s[0]),1,s[0])
# Judge status: Wrong Answer
import math
a=list(map(int,input().split()))
a.sort()
cnt=0
if a[0]==a[1]==a[2]:
  print(0)
  exit()
if a[0]==[1]:
  print(a[2]-a[1])
  exit()
if a[1]==a[2]:
  if (a[2]-a[0])%2==0:
    print((a[2]-a[0])//2)
    exit()
  else:
    print(a[2]-a[0]+1)
    exit()
cnt+=a[2]-a[1]
a[0]+=cnt
if (a[2]-a[0])%2==0:
  cnt+=math.ceil((a[2]-a[0])/2)
else:
  cnt+=math.ceil((a[2]-a[0])/2+1)
print(cnt)
# Judge status: Accepted
A, B, C = [int(i) for i in input().split()]
rem = set()
for i in range(1,B+1):
    rem.add((A*i)%B)
print("YES" if C in rem else "NO")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
maxx, h = 0, 0
for i in range(n):
	maxx = max(maxx, a[i])
	h += maxx - a[i]
print(h)
# Judge status: Accepted
n, k = [int(i) for i in input().split()]

prob = num_of_heads =  0
for i in range(n, 0, -1):
    while i * 2 ** num_of_heads < k:
        num_of_heads += 1
    prob += (1/n) * (1/2)**num_of_heads

print(prob)
# Judge status: Accepted
W,a,b = map(int,input().split())
print(max(0,b-(a+W),a-(b+W)))
# Judge status: Accepted
a,v,b,w,t=map(int,open(0).read().split())
if v==w:
    print("YES" if a==b else "NO")
elif v>w:    
    print("YES" if abs(a-b)/(v-w)<=t else "NO")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
cnt = {}
for i in range(n):
    s = input()
    if s not in cnt:cnt[s] = 1
    else:cnt[s] +=1
print(len(cnt))
# Judge status: Accepted
import sys
input = sys.stdin.readline


def read():
    N, M = map(int, input().strip().split())
    return N, M


def solve(N, M):
    if N > M:
        N, M = M, N
    if N == 1 and M == 1:
        return 1
    elif N == 1:
        return M - 2
    else:
        return (N-2) * (M-2)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))
# Judge status: Accepted
x = int(input())
a = x // 11
b = x % 11
if b == 0:
    print(2 * a)
elif b > 6:
    print(2 * a + 2)
else:
    print(2 * a + 1)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
total=0
A_li=[0]*(1+2*10**5)
for i in range(N):
    A_li[A[i]]+=1
for i in range(1+2*10**5):
    total+=A_li[i]*(A_li[i]-1)//2
for i in range(1,N+1):
    if A_li[A[i-1]]>1:
        print(total-(A_li[A[i-1]]-1))
    else:
        print(0)
# Judge status: Wrong Answer
N,A,B=map(int,input().split())
if A==0 :
  print(0)
elif A>=N :
  print(N)
elif A+B<N :
  print(A+(N-(B+A)))
else :
  print(A)
# Judge status: Accepted
n = int(input())
a_list = [int(x) for x in input().split()]
x = y = z = 0
for a in a_list:
    if a % 4 == 0:
        x += 1
    elif a % 2 == 0:
        y += 1
    else:
        z += 1
print("Yes" if (y == 0 and x >= z - 1) or (y > 0 and x >= z) else "No")
# Judge status: Accepted
import math
a,b,c = map(int, input().split())
val1 = 4*a*b
val2 = (c-a-b)*(c-a-b)
if c-a-b<=0:
  print("No")
elif val1 < val2:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n, k = input().split()
list_in = list(map(int, input().split()))
print(list_in)
list_in.sort()

sum = 0
for i in range(int(k)):
    sum = sum + list_in[i]

print(sum)
# Judge status: Accepted
bai4_count=0
bai2_count=0
no = 0

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

for i in range(N):
    if a[i]%4==0:
        bai4_count+=1
    elif a[i]%2==0:
        bai2_count+=1
    else:
        no+=1
ans = False
if bai2_count>0:
    if bai4_count >= no:
        ans=True
    else:
        ans=False
else:
    if bai4_count+1 >= no:
        ans=True
    else:
        ans=False

print("Yes" if ans else "No")
# Judge status: Accepted
nt,kt = input().split()
n = int(nt)
k = int(kt)
i = 1
while n >= (k ** i):
  i = i+1
    
print(i)
# Judge status: Accepted

mod = pow(10, 9) + 7

def main():
    N, K = map(int, input().split())
    ans = 0
    for k in range(K, N+2):
        #ans += sum(range(N+1-k, N+1)) - sum(range(0, k)) + 1
        ans += (N*(N+1))//2 - ((N-k)*(N-k+1))//2 - ((k-1)*k)//2 + 1
        ans %= mod
    print(ans%mod)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
ans = "NO"
for i in range(1,b+1):
    if a%i == c:
        ans = "YES"
        break

print(ans)
# Judge status: Wrong Answer
n,m = map(int,input().split())
print(n*m-(n+m)*2+4 if min(n,m)!=1 else (n*m)-2 )
# Judge status: Wrong Answer
n = input()
 
if n in "9":
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s=list(input())
n=len(s)
if n==1:
    print("YES")
    exit()
if len(set(s))==2 and n==2:
    print("YES")
    exit()
if len(set(s))<3:
    print("NO")
    exit()
    
x,y,z=s.count("a"),s.count("b"),s.count('c')
if abs(x-y)>1 or abs(y-z)>1 or abs(z-x)>1:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
x=int(input())
if x==1:
  print(1)
  exit(0)
for i in range(1,100001):
  t=i*(i+1)//2
  s=(i+1)*(i+2)//2
  if t<x<=s:
    print(i+1)
    exit(0)
# Judge status: Wrong Answer
import math
n = int(input())
a = [1,1]
ans = 100000000000000
for i in range(int(math.sqrt(n))):
    a[0] += 1
    if(n%a[0] == 0):
        ans =min(ans,a[0] + int(n/a[0])-2)
    

a[1] = int(n/a[0])

print(ans)
# Judge status: Accepted
N = int(input())
T, A = list(map(int,input().split()))
H = list(map(int,input().split()))
diffs = [abs(A - (T - h * 0.006)) for h in H]
min_idx = -1
min = float('inf')
for i in range(len(diffs)):
    if min > diffs[i]:
        min = diffs[i]
        min_idx = i
print(min_idx+1)
# Judge status: Accepted
A,B,C,K=map(int,input().split())
r=min(A,K)
K-=r
A-=r
ans=r
K -= min(B,K)
r=min(K,C)
ans-=r
print(ans)
# Judge status: Wrong Answer
N, K, Q = map(int, input().split())

la = list()
for i in range(Q):
    la.append(int(input()))

lcount = [0] * N
for i in range(Q):
    lcount[la[i]-1] += 1
print(lcount)
for i in range(N):
    if K+lcount[i]-Q > 0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
from bisect import bisect_left
n = int(input())
list_L = list(map(int, input().split()))
list_L.sort()
ans = 0

for i in range(n):
    for j in range(i+1, n):
        ans += bisect_left(list_L, list_L[i]+list_L[j]) - j - 1

print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
n = ""
if a > b:
    for i in range(a):
        n += str(b)
elif a < b:
    for i in range(b):
        n += str(a)
else:
    for i in range(a):
        n += str(a)
print(n)
# Judge status: Accepted
N=int(input())
h=list(map(int,input().split()))
h1=abs(h[0]-h[1])
h0=0
for i in range(1,N-1):
    h0,h1=h1,min(
    abs(h[i+1]-h[i-1])+h0,
    abs(h[i+1]-h[i])+h1
    )
print(h1)
# Judge status: Accepted
# 3つの整数A,B,C。CがA以上かつB以下か判定。

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

if A <= C <= B:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
radius = input()

radius *= 2

print(radius)
# Judge status: Wrong Answer
ans = [1]*365
for i in range(365):
    ans[i]=i%25 + 2
for i in range(365):
    print(i,ans[i])
# Judge status: Accepted
# 158 A
S = input()
print('No') if S == 'AAA' or S == 'BBB' else print('Yes')
# Judge status: Accepted
a, b, c = map(int, input().split())
if (a <= c <= b):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys

sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    L = [chr(i) for i in range(97, 97 + 26)]

    res = ""
    i = 1
    while n:
        r = n % 26
        res += L[r - 1]
        n = (n - i) // 26
        i += 1
    print(res[::-1])


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
N, x = map(int, input().split())
A = list(map(int, input().split()))
A.append(0)
CA = [a for a in A]
for i in range(N):
    total = CA[i] + CA[i+1]
    if x < total:
        if CA[i + 1] <= (total - x):
            rest = total - x - CA[i + 1]
            CA[i + 1] = 0
            CA[i] -= rest
        else:
            CA[i + 1] -= total - x


cnt = 0
for a, ca in zip(A, CA):
    cnt += (a - ca)
print(cnt)
# Judge status: Accepted
def ABC_135_A():
    A,B = map(int, input().split())

    if (A+B)%2 == 0:
        print(int((A+B)/2))
    else:
        print('IMPOSSIBLE')

if __name__ == '__main__':

    ABC_135_A()
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n-k):
    if a[i+k] <= a[i]:
        print('No')
    else:
        print('Yes')
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!
import math
n=int(input())
K=3
dp=[[0]*K for _ in range(n)]

for i in range(n):
    a=list(map(int,input().split()))
    for j in range(K):
        for k in range(K):
            if j==k:
                continue
            dp[i][j]=max(dp[i][j],dp[i-1][k]+a[k])
print(max(dp[n-1]))
# Judge status: Wrong Answer
w, a, b = map(int, input().split())
if a <= b and b <= a+w:
    print(0)
elif b <= a+w and a <= b:
    print(0)
elif b + w < a:
    print(min(a-b-w, a+w-b))
# Judge status: Accepted
a, b = map(int, input().split())
c = b - a
lb = 0
for i in range(1, c + 1):
  lb += i
print(lb - b)
# Judge status: Accepted
S = input().strip()
T = input().strip()

if S == T[:-1] and len(T) - 1 == len(S):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import sys
import math
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))
cnt_1 = 0
cnt_2 = 0
for i in range(n):
    if math.ceil(n / 2) > i:
        cnt_1 += a[i]
    else:
        cnt_2 += a[i]

print(abs(cnt_1 - cnt_2))
# Judge status: Wrong Answer
import numpy as np
INF = 2**60
N, W = map(int, input().split())
wv = [map(int, input().split()) for i in range(N)]
dp = np.full((N+1, W+1), -INF, dtype = np.int64)
dp[0][0] = 0 # 初期条件
for i, (w, v) in enumerate(wv):
    dp[i+1] = np.maximum(dp[i+1], dp[i])
    dp[i+1][w:] = np.maximum(dp[i+1][w:], dp[i][:-w] + v)
print(np.max(dp[N][:W]))
# Judge status: Wrong Answer
a = input()
m = 0
i = 0
s = 0
while i < len(a) :
    if a[i] == "S" :
        if m < s :
            m = s
        s = 0
    if a[i] == "R" :
        s = s + 1
    i = i + 1
print(m)
# Judge status: Wrong Answer
n,m = map(int,input().split())
if m%n==0:
    print(int(m//n))
    exit()
else:
  a = m//n
  for i in range(int(a**0.5)+1,1,-1):
    if m%i==0:
      print(i)
      exit()
  print(1)
# Judge status: Wrong Answer
n,k = map(int,input().split())
d = []
e = []
for i in range(k):
    d.append(input())
    e.append(input())
f = list(set(e))
g = len(f)
print(n-g)
# Judge status: Accepted
n,m = map( int, input().split())
  
result= {}
input_list = [[] for i in range(n)]


for i in range(m):
  p,y = map(int, input().split())
  input_list[p-1].append((y,i))
  
for i in input_list :
  i.sort()

result = [None]*m

for p,i in enumerate(input_list) :
  for n, (a,b) in enumerate(i):
    result[b] = str(p+1).zfill(6)+str(n+1).zfill(6)
    
print(*result, sep = '\n')
# Judge status: Accepted
n = int(input())
num = list(map(int,input().split()))
cnt = 1
ans = 0
if 1 not in num:
    print(-1)
    exit()
for i in range(n):
    if num[i] == cnt:
        cnt += 1
    else:
        ans += 1
print(ans)
# Judge status: Wrong Answer
a,b = list(map(int,input().split()))
if a < b:
    print(a-1)
else:
    print(a)
# Judge status: Accepted
def main():
    N, K = map(int, input().split())
    S = input()

    count = 0
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            count +=1 

    ans = min(count + K*2, N-1)
    print(ans)
    
main()
# Judge status: Accepted
N = int(input())
row1 = list(map(int, input().split()))
row2 = list(map(int, input().split()))

candies = []
for n in range(N):
  c1 = sum(row1[0:n + 1])
  c2 = sum(row2[n : N])
  candies.append(c1 + c2)

print(max(candies))
# Judge status: Accepted
n,l = map(int,input().split())

s = []

for i in range(n):
    s.append(list(map(str,input())))

s_ord = [[0]*(l) for i in range(n)]

for i in range(n):
    for j in range(l):
        s_ord[i][j] += ord(s[i][j])

s_ord_sorted = sorted(s_ord)

s_sorted = ""

for i in range(n):
    for j in range(l):
        s_sorted += chr(s_ord_sorted[i][j])

print(s_sorted)
# Judge status: Accepted
s = input().split()
a = int(s[0])
b = int(s[1])
k = int(s[2])




for i in range(a, min(b, a + k - 1) + 1):
    print(i)
for i in range(max(b - k + 1, a + k), b + 1):
    print(i)
# Judge status: Accepted
import heapq
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

AB = sorted(AB, key=lambda x: x[0])

x = 0
res = 0

hq = []
heapq.heapify(hq)

for i in range(M):
    for j in range(x, N):
        if AB[j][0] > i+1:
            x = j
            break
        heapq.heappush(hq, AB[j][1]*-1)
    else:
        x = N
    
    if hq:
        res += heapq.heappop(hq)*-1

print(res)
# Judge status: Wrong Answer
n,a,b=map(int,input().split())
s=input()
num=0
count=0
for i in s:
    if i=="a" and num<=a+b:
        num+=1
        count+=1
        print("Yes")
    elif i=="b" and num<=a+b and count<=b:
        num+=1
        count+=1
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
row1 = str(input())
row2 = str(input())

if row1[0]==row2[2] and row1[2]==row2[0] and row1[1]==row2[1]:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
def main():
    n = int(input())
    even = n // 2
    print(1 - even / n)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
x = int(input())

b = 360/x
print(int(b))
# Judge status: Accepted
import itertools
n,m,q = map(int,input().split())
num = [i for i in range(1,m+1)]
l = []
for i in range(q):
    r = list(map(int,input().split()))
    l.append(r)
l.sort()
stock = list(itertools.combinations_with_replacement(num, n))
ans = 0
for i in stock:
    s = 0
    for j in l:
        if i[j[1]-1] - i[j[0]-1] == j[2]:
            s += j[3]
            #print(s)
        #print(i[j[1]-1] - i[j[0]-1])
    if ans < s:
        ans = s
print(ans)
# Judge status: Wrong Answer
n=int(input())
A=sorted(list(map(int,input().split())))

minA=min(A)
for i in range(1,n):
    if 0<A[i]%minA<minA:
        minA=A[i]%minA

print(minA)
# Judge status: Accepted
M = 10**2 + 1
N = int(input())
L = [0 for _ in range(M**2+10)]
for i in range(1,M):
    for j in range(1,M):
        for k in range(1,M):
            n = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if n>N:
                break
            L[n] += 1
for i in range(1,N+1):
    print(L[i])
# Judge status: Wrong Answer
a, b, k = map(int, input().split())
ans = 0
for i in reversed(range(100)):
    if a % i == 0 and b % i == 0:
        ans += 1
        if ans == k:
            print(i)
            exit()
# Judge status: Wrong Answer
from bisect import bisect_left


n = int(input())
A = sorted(map(int, input().split()))
print(A[-1], A[bisect_left(A[:-1], A[-1] // 2)])
# Judge status: Wrong Answer
N,M = map(int, input().split())
A = list(map(int, input().split()))
sum = 0

for i in range(M):
    sum += A[i]

print(sum)
ans = N - sum

print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())
S = input()
passed = 0
passed_foreign = 0
ans = [False for _ in range(N)]

for i, human in enumerate(S):
    if human == 'a' and passed < A+B:
        passed += 1
        ans[i] = True
    if human == 'b' and passed < A+B and passed_foreign < B:
        passed += 1
        passed_foreign += 1
        ans[i] = True

for a in ans:
    print('Yes' if a else 'No')
# Judge status: Wrong Answer
n = int(input())
w = list(map(int, input().split()))
half_sum = sum(w) / 2

part_sum = 0
for val in w[:-1]:
  part_sum += val
  if part_sum >= half_sum:
    break
ans = int(half_sum*2 - part_sum*2)
ans = -ans if ans < 0 else ans
print(ans)
# Judge status: Accepted
array = list(map(int, input().split()))
K = int(input())

maxABC = max(array)
maxIndex = array.index(maxABC)
array.pop(maxIndex)

print(sum(array) + maxABC * 2**K)
# Judge status: Accepted
n, k = [int(x) for x in input().split()]

res = 0
for i in range(1, n+2):
    if i < k:
        continue
    max_sum = -(i**2)/2 + n*i + i/2
    min_sum = (i**2)/2 - i/2
    res += max_sum - min_sum + 1
    res = res % (10**9+7)
print(int(res))
# Judge status: Accepted
#!/usr/bin/env python

def f(a: int, b: int, c: int, d: int) -> int:
    """
    >>> f(-2, -1, -2, -1)
    4
    >>> f(-2, -1, 1, 2)
    -1
    >>> f(1, 2, 1, 2)
    4
    >>> f(1, 2, -2, -1)
    -1
    """
    return max(a * c, a * d, b * c, b * d)


if __name__ == '__main__':
    a, b, c, d = map(lambda x: int(x), input().split())
    print(f(a, b, c, d))
# Judge status: Accepted
#スペース区切りの整数の入力
h1, m1, h2, m2, k = map(int, input().split())

asa = h1 * 60 + m1
yoru = h2 * 60 + m2 - k


if(yoru<=asa):
  print("0")
else:
  print(yoru-asa)
# Judge status: Accepted
import bisect
N=int(input())

rllist=[]
for _ in range(N):
  X,L=map(int,input().split())
  rllist.append((X+L,X-L))
rllist.sort()
#print(rllist)

dp=[0]*N
for i in range(N):
  r,l=rllist[i]
  
  pos=bisect.bisect(rllist,(l,float("inf")))
  #print(i,pos)
  dp[i]=max(dp[i-1],dp[pos-1]+1)
  
#print(dp)
print(dp[-1])
# Judge status: Accepted
N,A,B=list(map(int,input().split()))
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

ans=0
for i in range(1,N+1):
  S=digitSum(i)
  if A<=S<=B:
    ans+=i
print(ans)
# Judge status: Accepted
N = int(input())
ans = []
if N == 0:
    print(0)
else:
    while N:
        ans.append(N % 2)
        N = -(N // 2)
    print("".join(map(str, ans[::-1])))
# Judge status: Accepted
x, n = map(int, input().split())
if n != 0:
    p = list(map(int, input().split()))
    #for i in range(n):
    #    p.append(input().split())
    #print(p)
    #rint(type(p[0]))
    min = 1e9
    ans = 0
    for i in range(102):
        #i = i + 1
        if i in p:
            continue
        sa = abs(x - i)
        #print(sa)
        if min > sa :
            min = sa
            ans = i
if n == 0:
    print(x)
else:
    print(ans)
# Judge status: Accepted
S = input()
T = input()

from collections import Counter

S_sorted = sorted(Counter(S).values(), reverse = True)
T_sorted = sorted(Counter(T).values(), reverse = True)

if S_sorted == T_sorted:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, K = LI()

    if N % K == 0:
        print(0)
    else:
        print(1)

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())

print(int(((a + b) * c) / 2))
# Judge status: Wrong Answer
from collections import Counter
N=int(input())
A=Counter(list(map(int,input().split())))
m=[]
for key,value in A.items():
    if value>=2:
        m.append(key)
print(sorted(m)[-1]**2 if len(m)>=4 else sorted(m)[-1]*sorted(m)[-2] if len(m)>=2 else 0)
# Judge status: Accepted
def divisor(i):
    s = []
    for j in range(1, int(i ** (1 / 2)) + 1):
        if i % j == 0:
            s.append(i // j)
            s.append(j)
    return sorted(set(s))

n, m = map(int, input().split())
l = m // n
s = divisor(m)
s.reverse()
for i in s:
    if m % i == 0 and l >= i:
        ans = i
        break
print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

a, b, c = mapint()

if c-(a+b)>=0:
    if 4*a*b<(c-a-b)**2:
        print('Yes')
    else:
        print('No')
else:
    print('No')
# Judge status: Accepted
#!/usr/bin/env python3

a, b, c = map(int, input().split())

if a+b == c or a+c == b or b+c == a:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
L = list(map(int,input().split()))

count = 0
for i in range(len(L)):
    for j in range(len(L)):
        for k in range(len(L)):
            if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j] and i != j and j != k and i != k:
                count += 1
print(count)
# Judge status: Wrong Answer
s = input()
for i in range(10):
    s = s[:-2]
    tnp = 0
    for j in range(len(s)//2):
        if (s[j]!=s[len(s)//2+j]):
            tnp += 1
    if (tnp==0):
        print(len(s))
        break
# Judge status: Accepted
#!/usr/bin/python
# -*- coding: utf-8 -*-

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

a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
xyc = []
for _ in range(0,M):
    xyc.append([int(x) for x in input().split()])

ans = 0

ans = min(a) + min(b)

coupon = []

for i in range(0,M):
    coupon.append(a[xyc[i][0]-1] + b[xyc[i][1]-1] - xyc[i][2])

ans = min(ans,min(coupon))

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

n = int(input())

if n == 0:
    print(0)
    exit()
ans = []
while(n != 0):

    rem = n % 2

    n = (n-rem)//(-2)

    ans.append(rem)

ans.reverse()

print("".join(map(str, ans)))
# Judge status: Accepted
n, m = map(int, input().split())
ab = sorted([tuple(map(int, input().split())) for i in range(n)])
i, ans = 0, 0
while ab[i][1] < m:
    m -= ab[i][1]
    ans += ab[i][1] * ab[i][0]
    i += 1
ans += ab[i][0] * m
print(ans)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

ans = "YES"
for i in range(n):
    if p[i] != i+1:
        if p[p[i]-1] == i+1:continue
        else: 
            ans = "NO"
            break
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()

out=0
for i in range(0,n):
  out+=a[2*i+1]

print(out)
# Judge status: Accepted
A = ['Sunny','Cloudy','Rainy']

S = input()

print(A[(A.index(S)+1)%3])
# Judge status: Accepted
S = input()
F = int(S[0:2])
SE = int(S[2:4])


if F > 12 and 1 <= SE <= 12:
  print("YYMM")
elif 1 <= F <= 12 and SE > 12:
  print("MMYY")
elif 1 <= F <= 12 and 1 <= SE <= 12:
  print("AMBIGUOUS")
elif F == 0 and 1 <= SE <= 12:
  print("YYMM")
elif 1 <= F <= 12 and SE == 0:
  print("MMYY")
else:
  print("NA")
# Judge status: Wrong Answer
N = int(input())
def solve(N):
    ans = ''
    while N != 0:
        ans += str(N & 1)
        N >>= 1
        N *= -1
    return ans[::-1]
print(solve(N))