Harryxun/stf_run huggingface dataset:
import copy
from itertools import permutations, product

n = int(input())
al = []
xyl = []
for i in range(n):
    a = int(input())
    al.append(a)
    tl = []
    for j in range(a):
        t = [int(i) for i in input().split()]
        tl.append(t)
    xyl.append(tl)

l = [i for i in product([0, 1], repeat=n)]

ans_list = []

for ll in l:
    ans_flag = 1
    for i in range(n):
        flag = 1
        for j in range(a):
            if ll[xyl[i][j][0]-1] != xyl[i][j][1]:
                flag = 0
        if flag != ll[i]:
            ans_flag = 0
    if ans_flag == 1:
        ans_list.append(copy.deepcopy(ll))

ans = 0
for i in ans_list:
    k = i.count(1)
    if ans < k:
        ans = k

print(ans)

### FIXED CODE ###

import copy
from itertools import permutations, product

n = int(input())
al = []
xyl = []
for i in range(n):
    a = int(input())
    al.append(a)
    tl = []
    for j in range(a):
        t = [int(i) for i in input().split()]
        tl.append(t)
    xyl.append(tl)

l = [i for i in product([0, 1], repeat=n)]

ans_list = []

for ll in l:
    ans_flag = 1
    for i in range(n):
        flag = 1
        for j in range(al[i]):
            if ll[xyl[i][j][0]-1] != xyl[i][j][1]:
                flag = 0
        if flag != ll[i]:
            ans_flag = 0
    if ans_flag == 1:
        ans_list.append(copy.deepcopy(ll))

ans = 0
for i in ans_list:
    k = i.count(1)
    if ans < k:
        ans = k

print(ans)
N = int(input())
rates = list(map(int, input().split()))

colors = [0]*9

for rate in rates:
    colors[rate // 400] += 1

if colors[0:8] == [0] * 8:
    print(1, min(colors[8], 8))
else:
    zeros = colors[0:8].count(0)
    print(8-zeros, 8-zeros+min(zeros, colors[8]))

### FIXED CODE ###

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

colors = [0]*9

for rate in rates:
    if rate < 3200:
        colors[rate // 400] += 1
    else:
        colors[8] += 1

zeros = colors[0:8].count(0)
nonzeros = 8 - zeros

M = nonzeros + colors[8]

if nonzeros == 0:
    m = 1
else:
    m = nonzeros

print(m, M)
N, M = int(input().split())

ans = 0

for i in range(1, 100000):
    p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
    ans += (100*(N-M) + 1900*M)*i*p

print(round(ans))

### FIXED CODE ###

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

ans = 0

for i in range(1, 100000):
    p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
    ans += (100*(N-M) + 1900*M)*i*p

print(round(ans))
n = int(input())
x = []
sum = 0
for i in range(n):
  s = int(input())
  sum += s
  x.append(s)
  
ave = s//n
sum = 0
for i in range(n):
  sum += (x[i] - ave)**2
min = sum
sum = 0
for i in range(n):
  sum += (x[i] - ave - 1)**2
max = sum 

if min > max:
  print(max)
else:
  print(min)

### FIXED CODE ###

n = int(input())
x = list(map(int, input().split()))
sum = 0
for i in range(n):
  sum += x[i]
  
ave = sum//n
sum = 0
for i in range(n):
  sum += (x[i] - ave)**2
min = sum
sum = 0
for i in range(n):
  sum += (x[i] - ave - 1)**2
max = sum 
 
if min > max:
  print(max)
else:
  print(min)
import sys
e=iter(sys.stdin)
while 1:
 a=b=0;n=int(e)
 if n==0:break
 for i in[0]*n:
  s,t=map(int,e.split())
  if s>t:a+=s+t
  elif s<t:b+=s+t
  else:a+=s;b+=t
 print(a,b)


### FIXED CODE ###

import sys
d=0
for e in sys.stdin:
 c=list(map(int,e.split()))
 if len(c)>1:
  s,t=c;d=1
  if s>t:a+=s+t
  elif s<t:b+=s+t
  else:a+=s;b+=t
 else:
  if d:print(a,b)
  a=b=0
import math
from decimal import *

def main():
    a, b, x = map(int, input().split())
    c = decimal(b) * decimal(b) * decimal(a)
    ans = math.degrees(math.atan(decimal(c)/decimal(x)))
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

from decimal import *
import math

def main():
    a, b, x = map(int, input().split())
    if a * a * b == x:
        print(0)
        exit()
    if Decimal(a) * Decimal(b) / Decimal(2) >= Decimal(x) / Decimal(a):
        tmp = Decimal(2) * Decimal(x) / (Decimal(a) * Decimal(b))
        c = math.atan(Decimal(tmp) / Decimal(b))
        d_deg = math.degrees(Decimal(c))
        print(Decimal(90) - Decimal(d_deg))
    else:
        d = (Decimal(2) * Decimal(x) / (Decimal(a) * Decimal(a))) - Decimal(b)
        c = math.atan(Decimal(a) / (Decimal(b) - Decimal(d)))
        d_deg = math.degrees(Decimal(c))
        print(Decimal(90) - Decimal(d_deg))


if __name__ == "__main__":
    main()
# -*- coding:utf-8 -*-


def binarySearch(A, key):
    left, right = 0, n
    while left < right:
        mid = (left + right) / 2
        if A[mid] == key:
            return True
        elif key < A[mid]:
            right = mid
        else:
            left = mid += 1
    return False

n = int(input())
S = [int(i) for i in range(n)]
q = int(input())
T = [int(i) for i in range(q)]

count = 0

for i in T:
    if (S,i):
        count += 1

print (count)

### FIXED CODE ###

# -*- coding:utf-8 -*-


def binarySearch(A, key):
    left, right = 0, n
    while left < right:
        mid = int((left + right) / 2)
        if A[mid] == key:
            return True
        elif key < A[mid]:
            right = mid
        else:
            left = mid + 1
    return False

n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

count = 0

for i in T:
    if binarySearch(S,i):
        count += 1

print (count)
n,m,k = map(int, input().split())
mod = 10**9+7
def cc(a,b):
  b = min(b,a-b)
  tot = 1
  for i in range(1,b+1):
    tot = (tot*(a-i+1)//i)%mod
  return tot
xans = 0
yans = 0
for i in range(1,n):
  xans+=i*(n-i)*m**2
  xans%=mod
for j in range(1,m):
  yans+=i*(m-i)*n**2
  yans%=mod
print((xans+yans)*cc(n*m-2,k-2)%mod)

### FIXED CODE ###

n,m,k = map(int, input().split())
n_ = n*m
mod = 10**9+7
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod

def nCr(n,r):
    if r > n:
        return 0
    return fun[n]*rev[r]%mod*rev[n-r]%mod
  
x = sum(i*(n-i) for i in range(n))%mod
y = sum(i*(m-i) for i in range(m))%mod
ans = (x*m**2 + y*n**2)%mod*nCr(n*m-2,k-2)%mod
print(ans)
import math

K=int(input())
S=0

for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      S+=gcd(gcd(i,j),k)

print(S)

### FIXED CODE ###

from math import gcd 

K=int(input())
S=0

for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      S+=gcd(gcd(i,j),k)

print(S)
n=int(input())

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

max=0
for i in range(n):
    for j in range(n):
        if i!=j:
            abs=abs(a[i]-a[j])
            if max<=abs:
                max=abs


print(max)
    


### FIXED CODE ###

n=int(input())

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

max=0
for i in range(n):
    for j in range(n):
        if i!=j:
            x=int(a[i]-a[j])
            if x<0:
                x *=-1
                if max<=x:
                    max=x


print(max)
N, K=map(int,input().split())2h=[int(input())foriinrange(N)]3h.sort()4print(min(h[i+K-1]-h[i]foriinrange(N-K+1)))

### FIXED CODE ###

n,k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
print(min(h[i+k-1] - h[i] for i in range(n-k+1)))
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input.split()
For i in range(N)
	if S[i] == "Y":
		print "Four"
		N = -1
		break
if N = -1:print "Three"

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = input()
S = raw_input().split()
for i in range(N):
	if S[i] == 'Y':
		print('Four')
		N = -1
		break
if N > -1:
	print('Three')
x, y, a, b, c = map(int, input().split())
plst = list(map(int, input().split()))
qlst = list(map(int, input().split()))
rlst = list(map(int, input().split()))
plst.sort()
qlst.sort()
rlst.sort(reverse = True)
plst = plst[-x:]
qlst = qlst[-y:]
r_pos = 0
p_pos = 0
q_pos = 0
while 1:
    if rlst[r_pos] <= plst[p_pos] and rlst[r_pos] <= qlst[q_pos]:
        break
    elif plst[p_pos] < qlst[q_pos]:
        plst[p_pos] = rlst[r_pos]
        p_pos += 1
        r_pos += 1
    else:
        qlst[q_pos] = rlst[r_pos]
        q_pos += 1
        r_pos += 1
    if p_pos == a or q_pos == b or r_pos == c:
        break
print(sum(plst) + sum(qlst))

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
plst = list(map(int, input().split()))
qlst = list(map(int, input().split()))
rlst = list(map(int, input().split()))
plst.sort()
qlst.sort()
rlst.sort(reverse = True)
inf = 10 ** 20
plst = plst[-x:] + [inf]
qlst = qlst[-y:] + [inf]
r_pos = 0
p_pos = 0
q_pos = 0
while 1:
    if rlst[r_pos] <= plst[p_pos] and rlst[r_pos] <= qlst[q_pos]:
        break
    elif plst[p_pos] < qlst[q_pos]:
        plst[p_pos] = rlst[r_pos]
        p_pos += 1
        r_pos += 1
    else:
        qlst[q_pos] = rlst[r_pos]
        q_pos += 1
        r_pos += 1
    if r_pos == c:
        break
print(sum(plst) + sum(qlst) - inf * 2)
a = [list(input().split()) for i in range(1)]
b=0
b = float(a[0]/a[1])
print(b)

### FIXED CODE ###

a = [list(input().split()) for i in range(1)]
b=0
c=0
b = int(a[0][0])
c =int(a[0][1])
print(b/c)
n = input()
a = map(int,raw_input().split())
b = a.reverse()
print b.replace("[","").replace(","," ").replace("[","")

### FIXED CODE ###

input()
print(" ".join(input().split()[::-1]))
N = int(input())
v = list(map(int,input().split()))

v.sorted(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)


### FIXED CODE ###

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

v.sort(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)
s = input()
k = int(input())
flag = 1
for i in range(min(k,s)):
    if s[i]!='1':
        flag = 0
        break
if flag:
    print(1)
else:
    print(s[1])


### FIXED CODE ###

s = input()
k = int(input())
flag = 1
for i in range(min(k,len(s))):
    if s[i]!='1':
        flag = 0
        a = s[i]
        break
if flag:
    print(1)
else:
    print(a)
N = int(input())
if N == 1:
  print('Hello World')
elif N == 2:
 {
   A = int(input())
   B = int(input())
   print(A+B)
 }
else:
  pass


### FIXED CODE ###

N = int(input())
if N == 1:
  print('Hello World')
elif N == 2:
    A = int(input())
    B = int(input())
    print(A+B)
else:
  pass
open(0)

while True:


    
    num = int(input())

    if num == 0:
        break
    
    scores = input().split()
    
    for i in range(num):
        scores[i] = float(scores[i])

    avr = sum(scores) / num
    
    daviation = 0
    
    for a in scores:
        disp = (a - avr)**2/num
        daviation += disp
        p

    print(round(math.sqrt(daviation),8))


### FIXED CODE ###

import math

daviations = []

while True:
    
    num = int(input())

    if num == 0:
        break
    
    scores = input().split()
    
    for i in range(num):
        scores[i] = float(scores[i])

    avr = sum(scores) / num
    
    daviation = 0
    
    for a in scores:
        disp = (a - avr)**2/num
        daviation += disp
        
        
        
    daviations.append(round(math.sqrt(daviation),8))
    
for b in daviations:
        print(b)
# coding: utf-8
# Your code here!


N,M=map(int,input().split())
S=[]
for i in range(M):
    S.append(list(map(int,input().split())))

S1 = sorted(S, key=lambda x: x[1]-x[0])
S1.reverse()
t=0
i=0
j=0
flug=False

while M-t>0 and i<M-t-1:
    j=0
    flug=False
    while M-t>0 and j<M-t-1:
        
        if S1[i][0]<=S1[j][0] and S1[i][1]>=S1[j][1] and i!=j:
            del S1[i]
            t+=1
            print(S1)
            flug=True
            break
        j+=1
    if flug==False:
        i+=1
        
        
x=0
y=1
z=0
count=0
nagasa=len(S)

while nagasa>x+z:
    hikaku=S1[x][1]
    flug=False
    while nagasa>y+z:
        if S1[y][0]<S1[x][1]:
            del S1[y]
            z+=1
            flug=True
        if flug==False:
            y+=1
    x+=1        
            

print(len(S1))


            

### FIXED CODE ###

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

#S = [[0 for j in range(3)] for i in range(2)]　2行3列の場合
S = [[0 for j in range(2)] for i in range(M)]

for i in range(M):
    X,L=map(int,input().split())
    S[i][0]=X
    S[i][1]=L


T=sorted(S,key=lambda x:x[1])
#U=sorted(T,key=lambda x:x[1])



count=1
last=T[0][1]
#print(T)
for i in range(1,M):
    if T[i][0]>=last:
        count+=1
        last=T[i][1]
print(count)
N, A = map(int,input().split())

print(N**2 - A)

### FIXED CODE ###

N = int(input())
A = int(input())

print(N ** 2 - A)
def f(p, x, r, tree):
  r[p-1] += x
  children = tree[p]
  for child in children:
    r = f(child, x, r, tree)
  
  return r

N, Q = list(map(int, input().split()))
keys = [i for i in range(1, N+1)]
values = [[] for i in range(N)]
tree = dict(zip(keys, values))

for i in range(N-1):
  a, b = list(map(int, input().split()))
  if a in tree.keys():
    tree[a] += [b]
  
  else:
    tree[a] = [b]

r = [0 for i in range(N)]    
for i in range(Q):
  p, x = list(map(int, input().split()))
  r = f(p, x, r, tree)

out = str(r[0])
for i in range(1, N):
  out += ' {0}'.format(r[i])

print(out)

### FIXED CODE ###

from collections import deque

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

tree = dict(zip([i for i in range(1, N+1)], [[] for _ in range(N)]))
for i in range(N-1):
  a, b = map(int, input().split())
  tree[a].append(b)
  tree[b].append(a)

counter = [0] * (N+1)
for i in range(Q):
  p, x = map(int, input().split())
  counter[p] += x

d = deque([[1, 0]])
while d:
  node, parent = d.popleft()
  counter[node] += counter[parent]
  children = tree[node]
  for child in children:
    if child == parent:
      continue
      
    d.append([child, node])
    
  
print(' '.join(map(str, counter[1:])))
s = input()
if s[0]=='R':
  if s[1]=='R':
    if s[2]=='R':
      print(3)
    else:
      print(2)
  else:
    print(1)
elif s[0]=='S':
  if s[1]=='R':
    if s[2]=='R':
      print(2)
    else:
      print(1)
  elif:
    if s[2]=='R':
      print(1)
    else:
      print(0)

### FIXED CODE ###

s = input()
if s[0]=='R':
  if s[1]=='R':
    if s[2]=='R':
      print(3)
    else:
      print(2)
  else:
    print(1)
elif s[0]=='S':
  if s[1]=='R':
    if s[2]=='R':
      print(2)
    else:
      print(1)
  else:
    if s[2]=='R':
      print(1)
    else:
      print(0)
# coding: utf-8
# Your code here!

import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,*p = map(int,read().split())
N = n*n

dist = [0]*N

for a in range(n):
    for b in range(n):
        dist[a*n+b] = min(a,n-1-a,b,n-1-b)

#print(dist)


#ans = [0]*N
ans = 0
iru = [1]*N

move = [-n,-1,1,n]
for pi in p:
    pi -= 1

    ans += dist[pi]
    iru[pi] = 0

    q = [pi]
    #更新
    
    while q:
        #print(q)
        v = q.pop()
        for i in range(4):
            if i==2 and v%n==n-1: continue
            if i==1 and v%n==0: continue
            if i==0 and v < w: continue
            if i==3 and v+n >= N: continue
            nv = v+move[i]
            if dist[nv] > dist[v] + iru[v]:
                q.append(nv)
                dist[nv] = dist[v] + iru[v]
        
                    
    #print(dist)        

print(ans)
if n==3: print(1)








### FIXED CODE ###

# coding: utf-8
# Your code here!

import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,*p = map(int,read().split())
N = n*n

dist = [0]*N

for a in range(n):
    for b in range(n):
        dist[a*n+b] = min(a,n-1-a,b,n-1-b)

#print(dist)


#ans = [0]*N
ans = 0
iru = [1]*N

for pi in p:
    pi -= 1

    ans += dist[pi]
    iru[pi] = 0

    q = [pi]
    #更新
    
    while q:
        #print(q)
        v = q.pop()
        for i in [-n,-1,1,n]:
            if i==1 and v%n==n-1: continue
            if i==-1 and v%n==0: continue
            nv = v+i
            if 0 <= nv < N and dist[nv] > dist[v] + iru[v]:
                q.append(nv)
                dist[nv] = dist[v] + iru[v]
        
                    
    #print(dist)        

print(ans)
N = int(input())
S = str(input())
T = str(input())
ans = ""

for i in range(N):
    ans += S[i]+T[i]
print(str(ans))

### FIXED CODE ###

N = int(input())
S,T = input().split()
ans = ""
 
for i in range(N):
    ans += S[i]+T[i]
print(ans)
N = int(input())
points = [[int(s) for s in input().split()] for i in range(N)]
h_max = max(h for x, y, h in points)

for Cx in range(101):
    for Cy in range(101):
        kouho = set()
        for x, y, h in points:
            if len(kouho) > 1:
                break  # 頂点が一意でない

            if h > 0:
                kouho.add(h + abs(x - Cx) + abs(y - Cy))
            else:
                if list(kouho)[0] - abs(x - Cx) - abs(y - Cy) != 0:
                    kouho = set()
                    break

        if len(kouho) == 1:
            print('{} {} {}'.format(Cx, Cy, list(kouho)[0]))
            exit()


### FIXED CODE ###

N = int(input())

points = [None] * N
for i in range(0, N):
    points[i] = list(map(int, input().split()))

h_max = max([h for x, y, h in points])

for H in range(h_max + 100, h_max - 1, -1):
    for Cx in range(101):
        for Cy in range(101):
            ok = True
            for X, Y, h1 in points:
                h2 = max(H - abs(X - Cx) - abs(Y - Cy), 0)
                if h1 != h2:
                    ok = False
                    break
            if ok:
                print('{} {} {}'.format(Cx, Cy, H))
                exit()
a, b, c, d = map(int, input()split())
if abs(a - c) <= d:
	print('Yes')
else:
	if abs(a - b) <= d and abs(c - b) <= d:
		print('Yes')
	else:
		print('No')

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if abs(a - c) <= d:
	print('Yes')
else:
	if abs(a - b) <= d and abs(c - b) <= d:
		print('Yes')
	else:
		print('No')
S = list(input())
T = list(input())

ck = 0
tl = len(T)
arr = []

for i in range(len(S)):
  a = S[i]
  if a == T[ck] or a == "?":
    ck += 1
  else:
    ck = 0
  if tl == ck:
    arr.append(i-tl+1)
  
if len(arr) == 0:
  print("UNRESTORABLE")
else:
  b = arr[-1]
  ans = ""
  for i in range(len(S)):
    if i == b:
      ans += ''.join(T)
    elif i > b and i <= b + tl:
      continue
    else:
      if S[i] == "?":
        ans += "a"
      else:
        ans += S[i]
  print(ans)

### FIXED CODE ###

s=input()
t=input()
ans=[]
for i in range(len(s)-len(t)+1):
  start=i
  end=i+len(t)
  ok=True
  for j in range(len(t)):
    if s[start+j]!='?' and s[start+j]!=t[j]:
      ok=False
      break
  if ok:
    a=s[:start]+t+s[end:]
    ans.append(a.replace('?','a'))
if ans:
  ans=sorted(ans)
  print(ans[0])
else:
  print('UNRESTORABLE')
# -*- coding: utf-8 -*-
w = raw_input()
c = 0
while 1:
 t = raw_input().lower()
 if t=="END_OF_TEXT": break
 tt = t.split()
 c += tt.count(w)
print c

### FIXED CODE ###

# -*- coding: utf-8 -*-
w = raw_input().upper()
c = 0
while 1:
 t = raw_input()
 if t=="END_OF_TEXT": break
 c += t.upper().split().count(w)
print c
n = int(input())
 
for i in range(1, 9)
  for j in range(1, 9)
    if n == i * j:
      print("Yes")
      break
 
print("No")


### FIXED CODE ###

n = int(input())
ans = ('No')
for i in range(1,10):
    for j in range(1,10):
        if i * j == n:
            ans = ('Yes')
            break
print(ans)
n = int(input())
a = [[0]*n for i in range(n)]

for i in range(n):
    v = list(map(int, input().split()))
    for j in range(v[1]):
        a[u - 1][v[2 + j] - 1] = 1

for i in range(n):
    print(*a[i])

### FIXED CODE ###

n = int(input())
a = [[0]*n for i in range(n)]
    
for i in range(n):
    v = list(map(int, input().split()))
    u = v[0] - 1
    for j in v[2:]:
        a[u][j - 1] = 1
    print(*a[i])
a,b,k=map(int,input().split())
 
for a,b in range(k):
	if a >=  1:
    	a -= 1
  
	elif a < 1 and b >= 1:
		b -= 1
        
print (a,b)

### FIXED CODE ###

s = input().split()
print(s[1] + s[0])
n = input().strip()
for i in range(1, n+1):
    if i == n:
        print("x")
    else:
        print("x", end="")

### FIXED CODE ###

A = input().strip()
n = len(A)
for i in range(1, n+1):
    if i == n:
        print("x")
    else:
        print("x", end="")
import sys
sys.setrecursionlimit(10 ** 6)


def dfs(num):
    global N, ans, M
    n = len(num)
    if n == N:
        cnt = 0
        for a, b, c, d in con:
            a -= 1; b -= 1
            if num[b] - num[a] == c:
                cnt += d
        ans = max(ans, cnt)
    else:
        e = 1 if n == 0 else num[-1]
        for i in range(e, M + 1):
            dfs((*num, i))


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

ans = 0
dfs(tuple())

print(ans)


### FIXED CODE ###

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


def f(x):
    global A, B
    return (A * x) // B - A * (x // B)


if N < B:
    print(f(N))
else:
    print(f(B - 1))
import math
N=int(input())
sqn=math.floor(math.sqrt(N))

for fac in reversed(range(sqn)):
    if N%fac==0:
        print(int(fac+N/fac-2))
        break

### FIXED CODE ###

import math
N=int(input())
sqn=math.floor(math.sqrt(N))

for fac in reversed(range(sqn+1)):
    if N%fac==0:
        print(int(fac+N/fac-2))
        break
j=int(input())
print([2**i for i in range(8) if 2**i<=N][-1])


### FIXED CODE ###

N=int(input())
print([2**i for i in range(8) if 2**i<=N][-1])
l, r = map(int, input().split())
l = lr[0]
r = lr[1]
 
ans=2019
l_2019 = l % 2019
r_2019 = r % 2019
 
for i in range(l_2019,r_2019):
    for j in range(i+1, r_2019+1):
        new_ans = (i * j) % 2019
        if new_ans < ans:
            ans = new_ans
        
print(ans)

### FIXED CODE ###

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

l = lr[0]
r = lr[1]

ans=2018
tr=min(2019, r-l)
for i in range(l, l+tr):
    for j in range(l+1, l+tr+1):
        ans = min(ans, (i*j)%2019)
        
        
print(ans)
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
b.reverse()
p = 1
c = 0
d = 0
for i in range(n):
    if a[i] == b[i]:
        v = a[i]
        h = i
        p = 0
        break
if p == 1:
    print('Yes')
    for i in range(n):
        print(b[i],end = ' ')
else:
    for i in range(n):
        if a[i] != v and b[i] != v:
            c += 1
        if b[i] == a[i] :
            d += 1
    if c < d:
        print('No')
    else:
        print('Yes')
        o = 0
        for i in range(n):
            if a[i] != v and b[i] != v:
                b[i],b[i+h] = b[i+h],b[i]
                o += 1
                if o == d:
                    break
        for i in range(n):
            print(b[i],end = ' ')

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
b.reverse()
p = 1
c = 0
d = 0
for i in range(n):
    if a[i] == b[i]:
        v = a[i]
        h = i
        p = 0
        break
if p == 1:
    print('Yes')
    for i in range(n):
        print(b[i],end = ' ')
else:
    for i in range(n):
        if a[i] != v and b[i] != v:
            c += 1
        if b[i] == a[i] :
            d += 1
    if c < d:
        print('No')
    else:
        print('Yes')
        o = 0
        for i in range(n):
            if a[i] != v and b[i] != v:
                b[i],b[h+o] = b[o+h],b[i]
                o += 1
                if o == d:
                    break
        for i in range(n):
            print(b[i],end = ' ')
a,b=map(int,input().split())
print(a%(a//b))

### FIXED CODE ###

a,b=map(int,input().split())
print(int(a%b!=0))