import re





match = re.fullmatch(r'(?P<N>[0-9]+) (?P<K>[0-9]+)', eval(input()))

n = int(match.group('N'))

k = int(match.group('K'))



if n % k == 0:

    print((0))

else:

    print((1))
split = input().split()

n = int(split[0])

k = int(split[1])



if n % k == 0:

    print((0))

else:

    print((1))
import re

match = re.fullmatch(r"(?P<N>[0-9]+) (?P<K>[0-9]+)", eval(input()))
n = int(match.group("N"))
k = int(match.group("K"))
if n % k == 0:
    print((0))
else:
    print((1))

split = input().split()
n = int(split[0])
k = int(split[1])
if n % k == 0:
    print((0))
else:
    print((1))

-import re - -match = re.fullmatch(r"(?P<N>[0-9]+) (?P<K>[0-9]+)", eval(input())) -n = int(match.group("N")) -k = int(match.group("K")) +split = input().split() +n = int(split[0]) +k = int(split[1])