Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3

def switch_on_off(n, keta):
    bin_str = format(n, f'0{keta}b')
    return list(bin_str)

def check_light(n, N, s, index, P):
    switch = switch_on_off(n, N)
    sum = 0
    for v in s:
        sum += int(switch[int(v) - 1])
    if sum % 2 == P[index - 1]:
        return 1
    return 0

N, M = map(int, input().rstrip().split())
K = []
S = []
for _ in range(M):
    tmp = list(map(int, input().rstrip().split()))
    K.append(tmp[0])
    S.append(tmp[1:])
P = list(map(int, input().rstrip().split()))


ans = 0
for n in range(2 ** N):
    sum = 0
    for index, s in enumerate(S):
        sum += check_light(n, N, s, index, P)
    if sum == M:
        ans += 1

print(ans)


### FIXED CODE ###

#!/usr/bin/env python3

def switch_on_off(n, keta):
    bin_str = format(n, '0{}b'.format(keta))
    return list(bin_str)

def check_light(n, N, s, index, P):
    switch = switch_on_off(n, N)
    sum = 0
    for v in s:
        sum += int(switch[int(v) - 1])
    if sum % 2 == P[index]:
        return 1
    return 0

N, M = map(int, input().rstrip().split())
K = []
S = []
for _ in range(M):
    tmp = list(map(int, input().rstrip().split()))
    K.append(tmp[0])
    S.append(tmp[1:])
P = list(map(int, input().rstrip().split()))


ans = 0
for n in range(2 ** N):
    sum = 0
    for index, s in enumerate(S):
        sum += check_light(n, N, s, index, P)
    if sum == M:
        ans += 1

print(ans)
n = int(input)
if n%2 == 0:
  print(n)
else:
  print(n*2)

### FIXED CODE ###

n = int(input())
if n%2 == 0:
  print(n)
else:
  print(n*2)
a = list(map(int.input().split()))
if a[1]//a[0] == 0:
  print(0)
elif a[1]//a[0]> a[2]:
  print(a[2])
else:
  print(a[1]//a[0])

### FIXED CODE ###

a = list(map(int,input().split()))
if a[1]//a[0] == 0:
  print(0)
elif a[1]//a[0]> a[2]:
  print(a[2])
else:
  print(a[1]//a[0])
x,y=map(int,input().split())
def fun(x):
	price=0
	if x==3:
		price=100000
	elif x==2:
		price=200000
	elif x==1:
		price=300000
	return price
if x ==1 and y ==1:
	print(fun(x)+fun(y)+4Ω00000)
else:
	print(fun(x)+fun(y))

### FIXED CODE ###

x,y=map(int,input().split())
def fun(x):
	price=0
	if x==3:
		price=100000
	elif x==2:
		price=200000
	elif x==1:
		price=300000
	return price
if x ==1 and y ==1:
	print(fun(x)+fun(y)+400000)
else:
	print(fun(x)+fun(y))
N,Q = map(int, input().split())

score = [0 for _ in range(N)]
 
# 子頂点番号:親頂点番号のdictを生成する
d = {}
for i in range(1,N):
  a,b = map(int,input().split())
  d[b] = a
      
# スコア加算処理
for i in range(1,Q+1):
  p,x = map(int,input().split())
  score[p-1] = x  
for i in range(1,len(score)):
  addScore = score[d[i+1]-1]
  score[i] += addScore
print(*score)

### FIXED CODE ###

from collections import deque
n,q=map(int, input().split())
l=[[] for i in range(n+1)]
ans=[0]*(n+1)

for i in range(n-1):
    a,b=[int(j) for j in input().split()]
    l[a].append(b)
    l[b].append(a)
for i in range(q):
    p,x=[int(j) for j in input().split()]
    ans[p]+=x

que=deque()
que.append(1)
ll=[0]*(n+1)
while que:
    y=que.popleft()
    ll[y]=1
    for i in l[y]:
        if ll[i]==1:
            continue
        ans[i]+=ans[y]
        que.append(i)
print(*ans[1:])
N = 5
x = list(range(5))
for i in range(min(N - 1, K)):
    for j in range(N):
        if j == i:
            x[j] += N
        else:
            x[j] -= 1
            
print(N)
print(*x)

### FIXED CODE ###

K = int(input())

N = 50
x = [v + K // N for v in range(N)]
for i in range(K % N):
    for j in range(N):
        if j == i:
            x[j] += N
        else:
            x[j] -= 1
            
print(N)
print(*x)
n = int(input)

print('Hello World' if n == 1)

if n == 2:
    for _ in range(2):
        a = [int(input())]

    print(a[0]+a[1])

### FIXED CODE ###

n = int(input())

if n == 1:
    print('Hello World')

if n == 2:
    a = [int(input()) for _ in range(2)]

    print(sum(a))
n, k = int(input()), int(input())
lst = []
result = []
for i in range(n):
    lst.append(int(input()))
for i in range(k):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))

### FIXED CODE ###

n = list(int(num) for num in input().strip().split())
lst = list(int(num) for num in input().strip().split())[:n[0]]
result = []
for i in range(n[1]):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))
from sys import stdin
n = int(input())
a = list(map(int, stdin.readline().split()))
amax = max(a)
e = [0]*(amax+1)
ans = 0

for i in range(n):
    e[a[i]] += 1
    if e[a[i]] == 1:
        for j in range(2*a[i], amax, a[i]):
            e[i] += 2

print(e.count(i))

### FIXED CODE ###

from sys import stdin
n = int(input())
a = list(map(int, stdin.readline().split()))
a.sort()
amax = max(a)+1
e = [0]*amax
ans = 0

for i in range(n):
    e[a[i]] += 1
    if e[a[i]] == 1:
        for j in range(2*a[i], amax, a[i]):
            e[j] += 2

print(e.count(1))
S = int(input())

if S == 'Sunny':
  print(Cloudy)
  
if S == 'Cloudy':
  print(Rainy)
  
if S == 'Rainy':
  print(Sunny)

### FIXED CODE ###

S = input()

if S == 'Sunny':
  print('Cloudy')
  
if S == 'Cloudy':
  print('Rainy')
  
if S == 'Rainy':
  print('Sunny')
n = int(input())
h = list(map(int,input().split()))

for x in range(n-1):
    if h[x] <= h[x+1]:
        pass
    else:
        h[x] = h[x]-1

if n == 1:
    ans ='Yes'
for x in range(n-1):
    if h[x] <= h[x+1]:
        ans = 'Yes'
    else:
        ans = 'No'
        break
if h[n-1] <= h[n] and ans ='Yes':
    ans ='Yes'
if h[n-1] <= h[n] and ans ='No'
    ans ='No'

print(ans)

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
ans = "Yes"
for i in range(N - 1):
  diff = H[i + 1] - H[i]
  if diff >= 1:
    H[i + 1] -= 1
  elif diff < 0:
    ans = "No"
print(ans)
import sys

a,b = map(int(x) ,sys.stdin.readline().split())
area = a*b
surround = 2*(a+b)
print("%d %d" % (area, surround))

### FIXED CODE ###

import sys

a,b = map(int,sys.stdin.readline().split())
area = a*b
surround = 2*(a+b)
print("%d %d" % (area, surround))
from collections import defaultdict
from heapq import heappop, heappush

class Graph(object):

    def __init__(self):
        self.graph = defaultdict(list)

    def add_edge(self, a, b, w):
        self.graph[a].append((b, w))


class Dijkstra(object):
    def __init__(self, graph, s):
        self.g = graph.graph
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[s] = 0

        self.Q = []
        heappush(self.Q, (self.dist[s], s))
        while self.Q:
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, w in self.g[u]:
                alt = dist_u + w
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    heappush(self.Q, (alt, v))

    def s_d(self, goal):
        return self.dist[goal]



xs, ys, xg, yg = list(map(int, input().split()))
xyr = []
xyr.append([xs, ys, 0])
N = int(input())

for i in range(N):
    xyr.append(list(map(int, input().split())))
xyr.append([xg, yg, 0])

g_a = Graph()
for i in range(N + 1):
    for j in range(i + 1, N + 2):
        a, b = i, j
        R = ((xyr[i][0] - xyr[j][0]) * (xyr[i][0] - xyr[j][0]) + (xyr[i][1] - xyr[j][1]) * (xyr[i][1] - xyr[j][1]) ** 0.5
        if R > xyr[i][2] + xyr[j][2]:
            r = R - xyr[i][2] - xyr[j][2]
        else:
            r = 0
        g_a.add_edge(a, b, r)
        g_a.add_edge(b, a, r)

d_a = Dijkstra(g_a, 0)
print(d_a.s_d(N + 1))

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

class Graph(object):

    def __init__(self):
        self.graph = defaultdict(list)

    def add_edge(self, a, b, w):
        self.graph[a].append((b, w))


class Dijkstra(object):
    def __init__(self, graph, s):
        self.g = graph.graph
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[s] = 0

        self.Q = []
        heappush(self.Q, (self.dist[s], s))
        while self.Q:
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, w in self.g[u]:
                alt = dist_u + w
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    heappush(self.Q, (alt, v))

    def s_d(self, goal):
        return self.dist[goal]


xs, ys, xg, yg = list(map(int, input().split()))
xyr = []
xyr.append([xs, ys, 0])
N = int(input())

for i in range(N):
    xyr.append(list(map(int, input().split())))
xyr.append([xg, yg, 0])

g_a = Graph()
for i in range(N + 1):
    for j in range(i + 1, N + 2):
        R = ((xyr[i][0] - xyr[j][0]) * (xyr[i][0] - xyr[j][0]) + (xyr[i][1] - xyr[j][1]) * (xyr[i][1] - xyr[j][1]))
        R = R ** 0.5
        if R > xyr[i][2] + xyr[j][2]:
            r = R - xyr[i][2] - xyr[j][2]
        else:
            r = 0
        g_a.add_edge(i, j, r)
        g_a.add_edge(j, i, r)

d_a = Dijkstra(g_a, 0)
print(d_a.s_d(N + 1))
n=map(int,input())
check=list(map(int,input().split()))
f=0
for i in range(n):
    if check[i]%2==0:
        if check[i]%3==0 or check[i]%5==0:
            f=1
            
if f==1:
    print("APPROVED")
else:
    print("DENIED")

### FIXED CODE ###

n=int(input())
check=list(map(int,input().split()))
f=0
for i in range(n):
    if check[i]%2==0:
        if check[i]%3!=0 and check[i]%5!=0:
            f=1
                
if f==1:
    print("DENIED")
else:
    print("APPROVED")
def lower(upper):
    if upper==9:
        return [8,9]
    elif upper==0:
        return [0,1]
    else:
        return [upper-1,upper,upper+1]

def numerize(a):
    return sum([a[i]*(10**i) for i in range(len(a))])

def getRunruns(digit):
    if digit==1:
        return [(i,) for i in range(10)]
    elif digit==2:
        return [(k,i) for i in range(1,10) for k in lower(i)]
    else:
        runruns=getRunruns(2)
        for i in range(digit-2):
            runruns=[(k,)+i for i in runruns for k in lower(i[0])]
        return runruns

A1=[(i,) for i in range(10)]
A2=[(k,i) for i in range(1,10) for k in lower(i)]
A=A1+A2
Aprev=A2
K=int(input())
while len(A)<K:
    Aprev=[(k,)+i for i in Aprev for k in lower(i[0])]
    A+=Aprev
print(numerize(A[K]))


### FIXED CODE ###

def lower(upper):
    if upper==9:
        return [8,9]
    elif upper==0:
        return [0,1]
    else:
        return [upper-1,upper,upper+1]

def numerize(a):
    return sum([a[i]*(10**i) for i in range(len(a))])

def getRunruns(digit):
    if digit==1:
        return [(i,) for i in range(10)]
    elif digit==2:
        return [(k,i) for i in range(1,10) for k in lower(i)]
    else:
        runruns=getRunruns(2)
        for i in range(digit-2):
            runruns=[(k,)+i for i in runruns for k in lower(i[0])]
        return runruns

A1=[(i,) for i in range(10)]
A2=[(k,i) for i in range(1,10) for k in lower(i)]
A=A1+A2
Aprev=A2
K=int(input())
while len(A)<K+1:
    Aprev=[(k,)+i for i in Aprev for k in lower(i[0])]
    A+=Aprev
print(numerize(A[K]))
import sympy
import math

N, M = map(int, input().split())
factors = sympy.factorint(M)
print(factors)
num_pattern = 1;
for exponent in factors.values():
    if exponent < N:
        tmp_num_pattern = int(math.factorial(exponent + N -1) \
                            / (math.factorial(N-1)*math.factorial(exponent)))
    else:
        tmp_num_pattern = int(math.factorial(exponent + N -1) \
                            / (math.factorial(exponent)*math.factorial(N-1)))
        
    num_pattern = num_pattern * int(tmp_num_pattern)
print(int(num_pattern%(10**9 +7)))

### FIXED CODE ###

import time
import collections
import scipy.misc

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

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

factors = collections.Counter(prime_decomposition(M))
t_elps = time.time()
#print(f"{t_elps - t_strt} [sec]")
num_pattern = 1;

for exponent in factors.values():
    tmp_num_pattern = scipy.misc.comb(exponent + N -1, N-1, exact = True) 
    num_pattern = num_pattern * int(tmp_num_pattern)
    
print(num_pattern%(10**9+7))
import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n,m = m()

if m == 1 or 2*n-1 == m:
    print("No")
else:
    print("Yes")
    if n == 2:
        ans = [1,2,3]
        print(jo(ans))
    else:
        if m == 2:
            a = [3,2,1,4]
            ans = [i + 5 for i in range(n-2)] + a + [i + n+3 for i in range(n-3)]
        else:
            a = [m-1,m,m+1,m-2]
            i = 0
            ans = []
            for j in range(2*n-4):
                i += 1
                if j == n-1:
                    ans += a
                    i -= 1
                 else:
                    if i == m-2:
                        i += 4
                    ans.append(i)
        print(jo(ans))





### FIXED CODE ###

import sys,bisect as bs,collections as cl,heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

n,m = m()

if m == 1 or 2*n-1 == m:
    print("No")
else:
    print("Yes")
    if n == 2:
        ans = [1,2,3]
        print(jo(ans))
    else:
        if m == 2:
            a = [3,2,1,4]
            ans = [i + 5 for i in range(n-2)] + a + [i + n+3 for i in range(n-3)]
        else:
            a = [m-1,m,m+1,m-2]
            i = 0
            ans = []
            for j in range(2*n-4):
                i += 1
                if j == n-2:
                    ans += a
                    i -= 1
                else:
                    if i == m-2:
                        i += 4
                    ans.append(i)
        print(jo(ans))
n = int(input().strip())
L = list(map(int, input().strip().split()))
ans=10**6+1
for p in range(max(L[-1])+1):
    tmp=0
    for x in L:
        tmp+=(x-p)**2
    ans=min(ans,tmp)
print(ans)

### FIXED CODE ###

n = int(input().strip())
L = list(map(int, input().strip().split()))
ans=10**6+1
for p in range(max(L)+1):
    tmp=0
    for x in L:
        tmp+=(x-p)**2
    ans=min(ans,tmp)
print(ans)
n,q=map(int,input().split())
s=input()
ans_l=[0]*8
for i in range(n-1):
    tmp=s[i]+s[i+1]
    if tmp=='AC':
        ans_l[i+1]=ans_l[i]+1
    else:
        ans_l[i+1]=ans_l[i]
for i in range(q):
    l,r=map(int,input().split())
    print(ans_l[r-1]-ans_l[l-1])

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
ans_l=[0]*n
for i in range(n-1):
    tmp=s[i]+s[i+1]
    if tmp=='AC':
        ans_l[i+1]=ans_l[i]+1
    else:
        ans_l[i+1]=ans_l[i]
for i in range(q):
    l,r=map(int,input().split())
    print(ans_l[r-1]-ans_l[l-1])
n,x=map(int,input().split())
a=list(map(int,input()split()))
count=0
for i in range(n):
  if sum(a[:i+1])<=x:
    count+=1
print(count)

### FIXED CODE ###

n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
count=1
for i in range(n):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)
n, m = map(int, input().split())
dir = [[] for _ in range(m+1)]

for i in range(m):
    ta, tb = map(int, input().split())
    dir[a].append(b)
    dir[b].append(a)

ans = [0]*(n+1)
flag = [0]*(n+1)
flag[1] = 1
que = [1]
while len(que) != 0:
    #print('que: ', len(que), que)
    now = que.pop()
    for to in dir[now]:
        if flag[to] == 1:
            continue
        que.append(to)
        flag[to] != 1
        ans[to] = now
"""         print(to)
        ans[to] = now
        flag[to] = 1
        for toto in dir[to]:
            if flag[toto] != 1:
                que.append(toto) """
print('Yes')
for i in range(2,n+1):
    print(ans[i])

### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
dir = [[] for _ in range(n+1)]

for i in range(m):
    ta, tb = map(int, input().split())
    dir[ta].append(tb)
    dir[tb].append(ta)

ans = [0]*(n+1)
flag = [False]*(n+1)
flag[1] = True
que = deque([1])
while que:
    #print('que: ', len(que), que)
    now = que.popleft()
    for to in dir[now]:
        if flag[to]:
            continue
        que.append(to)
        flag[to] = True
        ans[to] = now

print('Yes')
for i in range(2,n+1):
    print(ans[i])
n = int(input())
A = [int(i) for i in input().split()]
S = [A[0]]
for i in range(n+1):
    S[i+1] = S[i] + A[i]
out = 0
for i in set(S):
    num = S.count(i)
    out += num*(num-1)//2
print(out)

### FIXED CODE ###

from collections import Counter
n = int(input())
A = [int(i) for i in input().split()]
S = [0]*(n+1)
for i in range(n):
    S[i+1] = S[i] + A[i]
def hello(data):
    dt = Counter()
    for i in data:
        dt[str(i)] += 1
    return dt
num = hello(S)
out = [i*(i-1)//2 for i in num.values() if i>1]
print(sum(out))
A,B = input().split()
A = int(A)
C1 = A*int(B[0])
C2 = A*int(B[2])*0.1
C3 = A*int(B[3])*0.01
Ans = C1+C2+C3
#print(C1)
#print(C2)
#print(C3)
Ans = math.floor(Ans)
print(Ans)

### FIXED CODE ###

import math
A,B = input().split()
A = int(A)
C1 = A*int(B[0])*100
C2 = A*int(B[2])*10
C3 = A*int(B[3])
Ans = C1+C2+C3
Ans = math.floor(Ans//100)
print(Ans)
def combinations(R, G, B, N):
    R, G, B, N = int(R), int(G), int(B), int(N)
    sorted_tuple = sorted((R, G, B), reverse=True)
    R = sorted_tuple[0]
    G = sorted_tuple[1]
    B = sorted_tuple[2]
    number_combos = 0
    print(R)
    print(G)
    print(B)
    for x in range(N + 1):
        N_modified_x = N - R * x
        for y in range(N_modified_x + 1):
            N_modified_y = N_modified_x - G * y
            for z in range(N_modified_y + 1):
                if B * z == N_modified_y:
                    number_combos += 1
    return number_combos

R, G, B, N = input().split(' ')
print(combinations(R, G, B, N))

### FIXED CODE ###

def combinations(N, K):
    N = int(N)
    K = int(K)
    if N == K:
        return 1
    else:
        return N - K + 1
    
N, K = input().split(' ')

print(combinations(N, K))
# coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop, heapify
import copy
import numpy as np
import sys
from functools import lru_cache
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]

@lru_cache(maxsize=None)
def dp(i, j):
    if i == 0:
        return 0 if j == 0 else -INF
    if j == 0:
        return max(dp(i - 1, 0) + a[i-1], dp(i - 1, 1) - a[i-1])
    else:
        return max(dp(i - 1, 0) - a[i - 1], dp(i - 1, 1) + a[i - 1])


n = I()
a = LI()
print(dp(n, 0))


### FIXED CODE ###

# coding=utf-8
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop, heapify
import copy
import numpy as np
import sys
from functools import lru_cache
INF = float('inf')
mod = 10**9+7
sys.setrecursionlimit(10 ** 6)


def lcm(a, b): return a * b / gcd(a, b)

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


@lru_cache(maxsize=None)
def dp(i, j):
    if i == 0:
        return 0 if j == 0 else -INF
    if j == 0:
        return max(dp(i - 1, 0) + a[i-1], dp(i - 1, 1) - a[i-1])
    else:
        return max(dp(i - 1, 0) - a[i - 1], dp(i - 1, 1) + a[i - 1])


n = I()
a = LI()


def main():
    print(dp(n, 0))


if __name__ == "__main__":
    main()
r=int(imput())

if r<1200:
    print("ABC")
elif r<2800:
    print("ARC")
else:
    print("AGC")


### FIXED CODE ###

r=int(input())

if r<1200:
    print("ABC")
elif r<2800:
    print("ARC")
else:
    print("AGC")
N = int(input())
s = []
for _ in range(N):
    s.append(input())
M = int(input())
t = []
for _ in range(M):
    t.append(input())
ans = []
for ss in set(s):
    ans.append(s.count(ss) - t.count(ss))
p = ans if ans > 0 else 0
print(p)

### FIXED CODE ###

N = int(input())
s = []
for _ in range(N):
    s.append(input())
M = int(input())
t = []
for _ in range(M):
    t.append(input())
ans = []
for ss in set(s):
    ans.append(s.count(ss) - t.count(ss))
p = max(ans) if max(ans) > 0 else 0
print(p)
# -*- coding: utf-8 -*-

def main():
    #入力
    [n, k] = [int(i) for i in input().split()] 
    h = [int(i) for i in input().split()] 

    print(len(able_ride_jet(k, h)))


def able_ride_jet(const, heights):
    """ ジェットコースターに乗れる人の身長のリストを返す関数
    """
    return list(filter(lambda x: x >= const, heights))


if __name__ == '__main__':
    main()

### FIXED CODE ###

n = int(input())

if n % 2 == 0:
  ans = 1 / 2
else:
  ans = (n // 2 + 1) / n
  
print(ans)