peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 # 998244353
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input())
    res = []
    digit = 0
    while n:
        if (n >> digit) & 1:
            res.append('1')
            coef = 1 if digit & 1 == 0 else -1
            n -= coef * (1 << digit)
        else:
            res.append('0')
        digit += 1
    res = ''.join(res[::-1]) if res else '0'
    print(res)
resolve()
# Judge status: Accepted
a,b = map(int, input().split())

if (a == 1):
  a = 14
if (b == 1):
  b = 14
  
if (a == b):
  print('Draw')
elif (a > b):
  print('Alice')
else:
  print('Bob')
# Judge status: Accepted
A, B = map(int, input().split())

if A >= 10 or B >= 10:
    print(-1)
    exit()

ans = A * B
print(ans)
# Judge status: Accepted
N = int(input())
flag = False
for i in range(1, 10):
  for j in range(1, 10):
    if N == i*j:
      flag = True
      break
if flag:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n, x, y = map(int, input().split())


def distance(i,j):
    d = abs(i-y)+1+abs(j-x)    
    d = min(j-i, d)
    return d

d = [0]*(n-1)
for i in range(1, n+1):
    for j in range(i+1,n+1):
        d[distance(i,j)-1] = d[distance(i,j)-1] + 1

for i in d:
    print(i)
# Judge status: Accepted
X, Y, Z = map(int, input().split())
tmp = X
X = Y
Y = tmp
tmp = X
X = Z
Z = tmp

print(X, Y, Z)
# Judge status: Wrong Answer
n,k = map(int,input().split())
X = list(map(int, input().split()))

ans = 10**6
for i in range(n-k):
  d1 = abs(X[i]) + abs(X[i] - X[i+k-1])
  d2 = abs(X[i+k-1]) + abs(X[i] - X[i+k-1])
  if ans > min(d1, d2):
    ans = min(d1,d2)
print(ans)
# Judge status: Accepted
n = int(input())
ans = 111
while ans < n:
    ans += 111
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())

from_1=[]
to_n=[]
for i in range(m):
    a,b=map(int,input().split())
    if a==1:
        from_1.append(b)
    if b==n:
        to_n.append(a)

if len(set(from_1) & set(to_n)) >= 1:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
# Judge status: Accepted
a,b,c=map(int,input().split())
if a+b>=c:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import numpy as np
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    if i >= k:
        ans += 1/n
    else:
        if k//i == 0 :
            num = 1
        else:
            num = int((np.log2(k/i)+1)//1)
        ans += (1/n)*(1/2)**num
    
print(ans)
# Judge status: Accepted
def main():
  n=int(input())
  a=list(map(int,input().split()))
  b=list(map(int,input().split()))
  c=[a[i]-b[i] for i in range(n)]
  c0=sum([ci for ci in c if ci>0])
  c1=sum([-2*((ci+2-1)//2) for ci in c if ci<0])
  print('Yes' if c1>=2*c0 else 'No')
if __name__=='__main__':
  main()
# Judge status: Wrong Answer
import math
from decimal import Decimal

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

print('Yes' if Decimal(str(math.sqrt(a)))+Decimal(str(math.sqrt(b))) < Decimal(str(math.sqrt(c))) else 'No')
# Judge status: Accepted
n, k = map(int, input().split())
ans = 0
for i in range(1,n + 1):
    a = 0
    while i < k:
        i *= 2
        a += 1
    ans += 1/n * (1/2)**a
print(ans)
# Judge status: Wrong Answer
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()
A = nl()

abstotal = sum([abs(i) for i in A])
absmin = min([abs(i) for i in A])
if n % 2 == 0:
    ans = abstotal
else:
    ans = abstotal - 2 * absmin
print(ans)
# Judge status: Wrong Answer
inputs = input().split()
A = list(map(int, inputs[1:]))

sum = 0

for i in range(1, len(A)):
  if A[i] < A[i-1]:
    sum += A[i-1] - A[i]
    A[i] = A[i-1]
    
print(sum)
# Judge status: Accepted
a=int(input())
b=a//3
c=a//5
d=a//15
print(a*(a+1)//2-3*b*(b+1)//2-5*c*(c+1)//2+15*d*(d+1)//2)
# Judge status: Accepted
n,m=map(int,input().split())
if n>m//2:
  print(m//2)
else:
  left=m-2*n
  print(n+left//4)
# Judge status: Accepted
n = int(input())
stones = input()
white = stones.count('.')
black = 0
ans = white
for c in stones:
    if c == '#':
        black += 1
    else:
        white -= 1
    score = black + white
    ans = min(score, ans)
print(ans)
# Judge status: Accepted
S = set(input())
if S == {"a", "b", "c"}:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        cnt = 0
        for k in a[i:i+m]:
            if not k[j:j+m]==b[cnt]:
                break
            cnt += 1
        else:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
x = list(map(int,input().split()))
c = x[2]
print("Yes" if sorted(x)[1] == c else "No")
# Judge status: Accepted
H,W=map(int,input().split())
def ABC(a):
    if a%2==1:
        return (a//2)+1
    elif a%2==0:
        return a//2
if H>1 and W>1:
    ans=(H//2)*(W//2)+(ABC(H)*ABC(W))
    print(ans)
else:
    print(1)
# Judge status: Wrong Answer
k, a, b = map(int,input().split())

if b - a <= 2:
    print(k+1)
else:
    if ((k-(a-1))//2) == 1:
        print(((k-(a-1))//2)*(b)+((k-(a-1))//2)%2)
    else:
        print(((k-(a-1))//2)*(b-a)+((k-(a-1))//2)%2)
# Judge status: Accepted
#!/usr/bin/env python

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

a = sorted(a)
ma = a[-1]
div = [0 for _ in range(ma+1)]

for i in range(n):
    for j in range(a[i], ma+1, a[i]):
        div[j] += 1

ans = 0 
for i in range(n):
    if div[a[i]] == 1:
        ans += 1
print(ans)
# Judge status: Accepted
N=int(input())

mini=float("inf")
for A in range(1,N):
  B=N-A
  sa=str(A)
  sb=str(B)
  sum_a=0
  sum_b=0
  for st in sa:
    sum_a += int(st)
  for st in sb:
    sum_b += int(st)
  mini= min(mini, sum_a+sum_b)  
  
print(mini)
# Judge status: Accepted
n = int(input())
while len(set(str(n)))!=1:
	n+=1
print(n)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

if a<=c:
  if b>=c:
    print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())

for i in range(1,10):
    if n % i == 0 and n // i <= 9:
        print("Yes")
        exit()

print("No")
# Judge status: Accepted
ans = 0
X = int(input())

for i in range(1,1001):
    for j in range(2,1001):
        K = pow(i,j)
        if K > X:
            break
        ans = max(ans,K)

print(ans)
# Judge status: Accepted
n, q = map(int, input().split())
s = input()
a = [0] * n
for i in range(n-1):
  a[i+1] = a[i]
  if s[i:i+2] == 'AC':
    a[i+1] += 1
for i in range(q):
  l, r = map(int, input().split())
  print(a[r-1]-a[l-1])
# Judge status: Accepted
n = int(input())
cnt = 0
flag = 0
for i in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        cnt += 1
        if cnt == 3:
            flag = 1
            break
    else:
        cnt = 0

if flag == 0:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

a, v = map(int, input().split())
b, w = map(int, input().split())
T = int(input())

k = b - a
flag = False

if k >= 0:
    l = T*v - T*w 
    if (k <= l):
        flag = True

if k < 0:
    k = a - b
    l = T*w - T*v
    if (k <= l):
        flag = True


if (flag == True):
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
N = int(input())
S = input()
if S[:int(N/2):] == S[int(N/2)+1::]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
X = sorted(list(map(int, input().split())))

for i in range(N):
  if i>=N/2:
    print(X[N//2-1])
  else:
    print(X[N//2])
# Judge status: Accepted
import math

def main():
    a, b, x = map(int, input().split())
    if x < a * a * b / 2:
        tan = 2 * x / (b * b * a)
        print(90 - math.degrees(math.atan(tan)))
    else:
        tan = (2 / a) * (b - x / a**2)
        print(math.degrees(math.atan(tan)))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = []
for i, a in enumerate(input().split()):
  if i < K:
    A.append(a)
    continue
  else:
    A.append(a)
    x = A.pop(0)
    if x < a:
      print('Yes')
    else:
      print('No')
# Judge status: Wrong Answer
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
yaku = make_divisors(n)

Min = float('inf')
for i in range(int(len(yaku)/2)):
    Min = min(Min, yaku[i]+yaku[-(i+1)])

print(Min-2)
# Judge status: Accepted
from collections import Counter


N = int(input())
C = input()
C_cntr = Counter(C)

all_R_cnt = 0
all_W_cnt = 0
R_W_cnt = 0
for i in range(N):
    if C[i] == "W":
        all_R_cnt += 1
    elif C[i] == "R":
        all_W_cnt += 1
    if i < C_cntr.get("R", 0) and C[i] == "W":
        R_W_cnt += 1

print(min(all_R_cnt, all_W_cnt, R_W_cnt))
# Judge status: Accepted
a, b, c, d = list(map(int, input().split()))
list = sorted([a, b, c, d])
if list[0] == a and list[1] == b or list[2] == c and list[3] == d:
    print(0)
elif list[0] == c and list[1] == d or list[2] == a and list[3] == b:
    print(0)
else:
    print(list[2] - list[1])
# Judge status: Accepted
X, N = map(int, input().split())
if N == 0:
  print(X)
  exit()
p = list(map(int, input().split()))
ans = -float('inf')
d = float('inf')
for i in range(-10, 2100):
  if i not in p:
    if abs(X-i) < d:
      d = abs(X-i)
      ans = i

print(ans)
# Judge status: Accepted
n=int(input())

def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

a=divisor(n)
a.sort()

b=sorted(a,reverse=True)

c=[]
for i in range(len(a)//2+1):
    d=a[i]-1+b[i]-1
    c.append(d)

print(min(c))
# Judge status: Accepted
A, B, T = map(int, input().split())
T += 0.5
bis = B * int(T / A)
print(bis)
# Judge status: Accepted
h,w = map(int, input().split())
if h!=1 and w!=1: print(-(-h*w//2))
else:print('1')
# Judge status: Accepted
s = input()

if s[-1] != 's':
	print(s + 's')
else:
	print(s + 'es')
# Judge status: Accepted
def resolve():
    s = str(input())
    min_val = 10000
    for span in [s[i: i+3] for i in range(len(s))]:
        if abs(int(span) - 753) < min_val:
            min_val = abs(int(span) - 753)

    print(min_val)

resolve()
# Judge status: Accepted
A, B = list(map(int, input().split()))

C = A + B
ans = C // 2 if C % 2 == 0 else "IMPOSSIBLE"
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
l = 0
r = n
for i in range(m):
    lt, rt = map(int, input().split())
    l = max(l, lt)
    r=min(r,rt)
print(r-l+1)
# Judge status: Accepted
# coding: utf-8

A, B, K = [int(i) for i in input().split()]

if A - K <= 0:
    K = K - A
    A = 0
    B = B - K
    if B < 0:
        B = 0
    print(A, B)
else:
    A = A - K
    print(A, B)
# Judge status: Wrong Answer
N=int(input())
Boss=list(map(int, input().split()))
Boss.insert(0, 0)
for i in range(N):
    print(Boss.count(Boss[i]+1))
# Judge status: Accepted
from collections import defaultdict
n = int(input())
s = list(input())
cnt = defaultdict(int)
for c in s:
    cnt[c] += 1
ans = 1
for k, v in cnt.items():
    ans *= v + 1

print((ans - 1) % (10 ** 9 + 7))
# Judge status: Accepted
x,y=map(int,input().split())
print(x if x%y!=0 else -1)
# Judge status: Wrong Answer
A, B =map(int, input().split())
if A <= 5:
    print('0')
elif 6 <= A <= 12:
    print(B/2)
else:
    print(B)
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))
L.sort()
cnt = 0
for j in range(1,N-1):
    for i in range(j):
        for k in range(j+1,N):
            if L[i] + L[j] > L[k] and L[i] != L[j] and L[k] != L[j] and L[i] != L[k]:
                cnt += 1
print(cnt)
# Judge status: Accepted
n=input()
a=list(map(int,input().split()))
b=[i for i in a if i%2==0]
c=len(b)
d=[i for i in b if i%3==0]
e=len(d)     
f=[i for i in b if i%5==0]
g=len(f)
h=[i for i in b if i%15==0]
j=len(h)
if c==e+g-j:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Wrong Answer
n=int(input())
p=input().split()
ans=0
for i in range(1,n-1):
    if p[i+1]>p[i]>p[i-1] or p[i-2]>p[i-1]>p[i]:
        ans+=1
print(ans+1)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

minus=[]
abses=[]
cnt=0
for i in range(n):
    if a[i]<0:
        minus.append(1)
    elif a[i]>0:
        minus.append(0)
    else:
        minus.append(0)
        cnt+=1
    abses.append(abs(a[i]))

if sum(minus)%2==0:
    print(sum(abses))
else:
    if cnt>0:
        print(sum(abses))
    else:
        print(sum(abses)- 2*min(abses))
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=a[:1]
for i in range(n-1):
  x=list(map(int,input().split()))
  x=x[1:]
  for j in a:
    if j not in x:
      a.remove(j)
print(len(a))
# Judge status: Accepted
numbers = [int(i) for i in input().split()]
sequences = [int(i) for i in input().split()]
x = numbers[0]
y = numbers[0]
a = True
if numbers[0] not in sequences:
    print(numbers[0])
    a = False
while a:
    x += 1
    y -= 1
    if y not in sequences:
        print(y)
        break
    elif x not in sequences:
        print(x)
        break
# Judge status: Accepted
N = int(input())
d = list(sorted(list(map(int, input().split()))))

center = d[int(len(d) / 2) - 1]
ans = 0
while center + 1 <= d[int(len(d) / 2)]:
  ans += 1
  center += 1
print(ans)
# Judge status: Wrong Answer
import numpy as np

n,m,x = map(int,input().split())
ca = list(list(map(int,input().split())) for _ in range(n))

ans = 10**6
for i in range(1,2**n):
  l = []
  for j in range(n):
    if (i >> j) & 1:
      l.append(ca[j])
  s = np.sum(l,axis=0).tolist()
  if all(s[k] >= x for k in range(1,m+1)) and s[0] < ans:
    ans = s[0]

if ans == 10**6:
  print(-1)
else:
  print(ans)
# Judge status: Accepted
N=int(input())
fn=N
li=[0]*(10**6+100)
flag=False
if N==1:
  print(0)
  exit()
for i in range(2,int(N**0.5)+1):
  while N%i==0:
    flag=True
    N/=i
    li[i]+=1
if flag==False:
  print(1)
  exit()

ans=0
if N>fn**0.5:
  ans+=1
  
for count in li:
  use=1
  while count-use>=0:
    ans+=1
    count-=use
    use+=1
print(ans)
# Judge status: Accepted
import collections
from collections import Counter
N=int(input())
a=input().split()
A=[int(number) for number in a]
pluss=[]
minuss=[]
number=1
for a in A:
    plus=a+number
    minus=number-a
    pluss.append(plus)
    minuss.append(minus)
    number+=1

m=Counter(minuss)

answer=0
for p in pluss:
    if p in m.keys():
        answer+=m[p]
print(answer)
# Judge status: Wrong Answer
S=input()
s=[0 for i in range(len(S))]

for i in range(len(S)):
    s[i]=int(S[i])
CHECK=[0 for i in range(2021)]
ans=0
temp=0
for i in range(1,len(s)+1):
    #print(s[-i])
    temp=(temp+s[-i]*pow(10,i-1,2019)+2019*2)%2019
    #print(i,temp)
    #print(temp)
    if temp==0:
        ans+=1
    elif CHECK[temp]==0:
        CHECK[temp]=1
    elif CHECK[temp]!=0:
        ans+=1
 
print(ans)
# Judge status: Accepted
# B - Iron Bar Cutting
from bisect import bisect
from itertools import accumulate


def main():
    N, *A = map(int, open(0).read().split())
    cumsum = tuple(accumulate(A))
    idx = bisect(cumsum, cumsum[-1] // 2)
    print(min(cumsum[idx] * 2 - cumsum[-1], cumsum[-1] - cumsum[idx - 1] * 2))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N, M = map(int, input().split())

ans_list = []
pen_num = 0
cor_num = 0

for i in range(M):
  p_i, S_i = input().split()
  p_i = int(p_i)
  
  if not (p_i in ans_list and p_i<=N):
    if(S_i == "WA"):
      pen_num += 1
    elif(S_i == "AC"):
      cor_num += 1
      ans_list.append(p_i)
      
print("{} {}".format(cor_num,pen_num))
# Judge status: Accepted
import itertools
import sys
import math
import numpy as np
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
from bisect import insort
sys.setrecursionlimit(10**9)

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

    ch_max = 0
    for a in A:
        if ch_max + 1 == a:
            ch_max += 1

    if ch_max == 0:
        print(-1)
        exit()

    print(N - ch_max)




if __name__ == "__main__":
  main()
# Judge status: Accepted
N = int(input())
P = list(map(int,input().split()))
cnt = 1
flag = 0 
for i in range(1,N):
    if P[i-1]>P[i] and flag == 0:
        flag = 1
    elif P[i-1]<P[i] and flag == 0:
        flag = 2
    elif flag == 1 and (P[i-1] < P[i]) :
        cnt += 1
        flag = 0
    elif flag == 2 and (P[i-1] > P[i]) :
        cnt += 1
        flag = 0
print(cnt)
# Judge status: Wrong Answer
a,b,=map(int,input().split())
if a+b<=24:
    print(a+b)
else:
    print(a+b-24)
# Judge status: Wrong Answer
k = int(input())
s = list(input())
result =[]
for i,letter in enumerate(s):
    result.append(letter)
    if k == 0:
        print("...")
        break
    elif i+1 == k:
        break
    elif i+1 > k:
        result.append("...")
        break
print("".join(result))
# Judge status: Wrong Answer
a=input()
b=abs(753-int(a[0]+a[1]+a[2]))
for i in range(int(len(a)-3)):
  if abs(753-int(a[i]+a[i+1]+a[i+2]))>abs(753-int(a[i+1]+a[i+2]+a[i+3])):
    b=abs(753-int(a[i+1]+a[i+2]+a[i+3]))
print(b)
# Judge status: Accepted
d,n = map(int, input().split())
if n == 100:
  n += 1
for i in range(d):
  n *= 100
print(n)
# Judge status: Accepted
n,k = map(int, input().split())
s = input()

print(s[:k-1]+s[k-1].swapcase()+s[k:])
# Judge status: Accepted
from math import pi, cos, sin, sqrt

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

A_th = ((H / 12) + (M / 60) / 12) * 2 * pi
B_th = (M / 60) * 2 * pi
A_x, A_y = A * cos(A_th), A * sin(A_th)
B_x, B_y = B * cos(B_th), B * sin(B_th)

print(sqrt(((A_x - B_x) ** 2 + (A_y - B_y) ** 2)))
# Judge status: Wrong Answer
N, M = map(int, input().split())

if N%2:
    for i in range(1, M+1):
        print(i, N-i)
else:
    for i in range(1, M+1):
        print(2*i-1, 2*i)
# Judge status: Accepted
import numpy as np
n,m,x=map(int,input().split())
a=2**64
b=[np.array(list(map(int,input().split())),"i8")for i in range(n)]
for i in range(2**n):
    c=bin(i)[2:]
    c="0"*(n-len(c))+c
    l=np.zeros(m)
    q=0
    for j in range(n):
        if c[j]=="1":
            q+=b[j][0]
            l+=b[j][1:]
    if np.min(l)>=x:
        a=min(a,q)
if a==2**64:
    print(-1)
else:
    print(a)
# Judge status: Wrong Answer
n = int(input())
hs = [int(elem) for elem in input().split()]

res = []
flag = 0
for i, h in enumerate(hs):
  if i == 0 :
    res.append(0)
  else:
    if res[-1] < 0 and (h - hs[i-1]) < 0:
      flag = 1
      break
    else:
      res.append(h - hs[i-1])
  
if flag == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    ans = 1
    while ans <= N: ans *= 2
    print(ans // 2)

if __name__ == "__main__":
    main()
# Judge status: Accepted
s = input()
S = {'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1 }
print(S[s])
# Judge status: Wrong Answer
import sys
N = int(input())
if(N%2 == 0):
	print('No')
	sys.exit(0)

# ss = list(str(N))
# re = 0
# for s in ss:
# 	re += int(s)
# if(re%9 == 0):
if(N%9 == 0):
	print('Yes')
# s = list(map(int, s))
# Judge status: Wrong Answer


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    s = input()
    
    count = 0
    for n in range(3):
        if s[n] == 1:
            count = count + 1
    
    print(count)
# Judge status: Accepted
n = int(input())
if n % 2 != 0:
  print(0)
  exit()

x = 5
ans = 0
while x <= n:
  ans += n//(2*x)
  x *= 5

print(ans)
# Judge status: Accepted
o = input()
e = input()
res = ""
if len(o)>len(e):
  for i in range(len(e)):
    res = res + o[i]
    res = res + e[i]
  res = res + o[len(o)-1]
else:
  for i in range(len(e)):
    res= res + o[i]
    res= res + e[i]
print(res)
# Judge status: Wrong Answer
N = int(input())
A = [int(a) for a in input().split()]

count = 0
summa = sum(A)
while summa % 2 == 0:
    summa = summa // 2
    count += 1

print(count)
# Judge status: Accepted
p = int(input())
index = 1
while True:
    if p* index % 360 == 0:
        print(index)
        break
    index += 1
# Judge status: Accepted
N=int(input())
flag=0

x=[list(map(int,input().split())) for _ in range(N)]
x.insert(0,[0,0,0])



for i in range(N):
  if abs(x[i][0]-x[i+1][0])<(abs(x[i][1]-x[i+1][1])+abs(x[i][2]-x[i+1][2])):
    flag=1
  if x[i][1]==x[i+1][1] and x[i][2]==x[i+1][2]:
    flag=1
  if abs(x[i][0]-x[i+1][0])%2!=(abs(x[i][1]-x[i+1][1])+abs(x[i][2]-x[i+1][2]))%2:
    flag=1

if flag==0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())
ans=1
for x in range(0,8):
  if n<pow(2,x):
    break
  ans=pow(2,x)
    
print(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
A = Counter(list(map(int,input().split())))
keys,counts = zip(*A.most_common())
total = 0
for key,count in zip(keys,counts):
    if key > count:
        total += count
    else:
        total += count-key
print(total)
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a,b=nii()
ans=0
for i in range(a,b+1):
  s=str(i)
  if s==s[::-1]:
    ans+=1

print(ans)
# Judge status: Wrong Answer
S = str(input())
L = sorted (S)
if L[0] == L[1] and L[2] == L[3] :
    print ('Yes')
else:
    print ('No')
# Judge status: Accepted
inputs = input()
answer = ''

for s in inputs:
    if s == '0':
        answer = answer + '0'
    elif s == '1':
        answer = answer + '1'
    elif s == 'B' and answer == '':
        answer = answer + ''
    elif s == 'B' and answer != '':
        answer = answer[:-1]
print(answer)
# Judge status: Wrong Answer
data = input()


if data >= 'a' and data <= 'z':
    print("A")
else:
    print("a")
# Judge status: Accepted
def main():
  import sys
  input = sys.stdin.readline
  n=input()
  a=tuple(map(int,input().split()))
  cnt=[0]*(max(a)+3)
  for i in a:
    cnt[i]+= 1
  x,y,z=cnt,cnt[1:],cnt[2:]
  print(max(map(sum,zip(x,y,z))))  
if __name__=='__main__':
  main()
# Judge status: Wrong Answer
S = [int(x) for x in input()]
cnt = 0

for i in range(0,2):
    if S[i] == S[i+1]:
        cnt += 1

if cnt >= 1:
    print("Bad")
else:
    print("Good")
# Judge status: Wrong Answer
N=int(input())
ans=0
i=2
while i<=N:
  ans=i
  i=i**2
print(ans)
# Judge status: Wrong Answer
import sys
n = int(sys.stdin.readline())
m = map(int, sys.stdin.read().split())
ab = list(zip(m, m))
res = 0
for i, j in ab[::-1]:
  if j != 1:
  	res += j - ((i + res) % j)
print(res)
# Judge status: Accepted
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))

for i in range(2):
    if c[0][i]-c[0][i+1]!=c[1][i]-c[1][i+1] or  c[1][i]-c[1][i+1]!=c[2][i]-c[2][i+1]:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
n = int(input())
S = set()

for _ in range(n):
    s = input()
    S.add(s)

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

import sys
import numpy as np
from itertools import groupby
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

S = readline().decode().rstrip()
cnt = [0] * (len(S) + 1)

for i in range(len(S)):
    if S[i] == '<':
        cnt[i + 1] = max(cnt[i + 1], cnt[i] + 1)

for i in range(len(S) - 1, -1, -1):
    if S[i] == '>':
        cnt[i] = max(cnt[i], cnt[i + 1] + 1)

print(sum(cnt))
# Judge status: Wrong Answer
N = int(input())
S = list(input().split())

print(f'AC x {S.count("AC")}')
print(f'WA x {S.count("WA")}')
print(f'TLE x {S.count("TLE")}')
print(f'RE x {S.count("RE")}')