Harryxun/stf_run huggingface dataset:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import defaultdict

n = int(readline())
data = list(map(int,read().split()))
mod = 1000000007

it = iter(data)
a_b = defaultdict(lambda :[0,0])
a0 = 0
b0 = 0
nums = []
ans = 0
for a,b in zip(it,it):
    if(a==b==0):
        ans[i] = 1
        continue
    if(a*b==0):
        if(a==0):
            a0 += 1
        if(b==0):
            b0 += 1
    else:
        if(a/b > 0):
            a_b[a/b][0] += 1
        else:
            a_b[-1*b/a][1] += 1

exp2 = [1] * (n+1)
for i in range(n):
    exp2[i+1] = exp2[i] * 2
    exp2[i+1] %= mod


ans += (ans+1) * ( exp2[a0]-1  + exp2[b0]-1)
ans %= mod

for key,val in a_b.items():
    ans += (ans+1) * ( exp2[val[0]]-1  + exp2[val[1]]-1)
    ans %= mod

print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import defaultdict
from math import gcd

n = int(readline())
data = list(map(int,read().split()))
mod = 1000000007

it = iter(data)
a_b = defaultdict(lambda :[0,0])
a0 = 0
b0 = 0
ab0 = 0
ans = 0
for a,b in zip(it,it):
    if(a==b==0):
        ab0 += 1
        continue
    if(a*b==0):
        if(a==0):
            a0 += 1
        if(b==0):
            b0 += 1
    else:
        if(a/b > 0):
            a = abs(a)
            b = abs(b)
            gcd_num = gcd(a,b)
            a_b[(a//gcd_num,b//gcd_num)][0] += 1
        else:
            a = abs(a)
            b = abs(b)
            gcd_num = gcd(a,b)
            a_b[(b//gcd_num,a//gcd_num)][1] += 1

exp2 = [1] * (n+1)
for i in range(n):
    exp2[i+1] = exp2[i] * 2
    exp2[i+1] %= mod


ans += (ans+1) * ( exp2[a0]-1  + exp2[b0]-1)
ans %= mod

for key,val in a_b.items():
    ans += (ans+1) * ( exp2[val[0]]-1  + exp2[val[1]]-1)
    ans %= mod

ans += ab0
ans %= mod

print(ans)
import collections
import itertools
from pprint import pprint as pp

H,W,D = tuple(map(int, input().split()))
A = [tuple(map(int, input().split())) for _ in range(H)]
Q = int(input())
LR = [tuple(map(int, input().split())) for _ in range(Q)]

Arev = [None] * (H*W+1)
for h in range(H):
  for w in range(W):
    Arev[A[h][w]] = (h,w)

tbl = []
for i in range(D):
  i += 1
  ary = []
  mp = 0
  start = Arev[i]
  for x in range(i, H*W, D):
    next_ = Arev[x]
    mp += abs(start[0]-next_[0]) + abs(start[1]-next_[1])
    ary.append((x,mp))
    start = next_
  tbl.append(ary)
for L,R in LR:
  col1, row = divmod(L, D)
  col2 = R // D
  if row == 0:
    col1 -= 1
    col2 -= 1
  row -= 1
  print(tbl[row][col2][1] - tbl[row][col1][1])


### FIXED CODE ###

import collections
import itertools
from pprint import pprint as pp

H,W,D = tuple(map(int, input().split()))
A = [tuple(map(int, input().split())) for _ in range(H)]
Q = int(input())
LR = [tuple(map(int, input().split())) for _ in range(Q)]

Arev = [None] * (H*W+1)
for h in range(H):
  for w in range(W):
    Arev[A[h][w]] = (h,w)

tbl = []
for i in range(D):
  ary = []
  mp = 0
  start = Arev[i+1]
  for x in range(i, H*W, D):
    next_ = Arev[x+1]
    mp += abs(start[0]-next_[0]) + abs(start[1]-next_[1])
    ary.append((x+1,mp))
    start = next_
  tbl.append(ary)
#pp(A)
#pp(tbl)
for L,R in LR:
  col1, row = divmod(L, D)
  col2 = R // D
  if row == 0:
    col1 -= 1
    col2 -= 1
  row -= 1
  #pp((row,col1,col2))
  print(tbl[row][col2][1] - tbl[row][col1][1])
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**7)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,k = na()

N = n

# N: 処理する区間の長さ
N0 = 2**(N-1).bit_length()
INF = 2**31-1
data = [0]*(2*N0)
# a_k の値を x に更新
def update(k, x):
    k += N0-1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = min(data[2*k+1], data[2*k+2])
# 区間[l, r)の最小値
def query(l, r):
    L = l + N0; R = r + N0
    s = INF
    while L < R:
        if R & 1:
            R -= 1
            s = min(s, data[R-1])

        if L & 1:
            s = min(s, data[L-1])
            L += 1
        L >>= 1; R >>= 1
    return s


for i in range(n):
    a = ni()
    s = a-k-1 if a-k-1 > 0 else 0
    e = a+k-1 if a+k < n else n
    update(a-1, query(s,e)-1)


print(-query(0,n)+1)


### FIXED CODE ###

import sys
stdin = sys.stdin
sys.setrecursionlimit(10**7)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,k = na()

N = 300000

# N: 処理する区間の長さ
N0 = 2**(N-1).bit_length()
INF = 2**31-1
data = [INF]*(2*N0)
# a_k の値を x に更新
def update(k, x):
    k += N0-1
    data[k] = x
    while k >= 0:
        k = (k - 1) // 2
        data[k] = min(data[2*k+1], data[2*k+2])
# 区間[l, r)の最小値
def query(l, r):
    L = l + N0; R = r + N0
    s = INF
    while L < R:
        if R & 1:
            R -= 1
            s = min(s, data[R-1])

        if L & 1:
            s = min(s, data[L-1])
            L += 1
        L >>= 1; R >>= 1
    return s


for i in range(n):
    a = ni()
    s = a-k if a-k > 0 else 0
    e = a+k+1 if a+k+1 < 300001 else 300001
    update(a, min(query(s,e)-1, -1))


print(-query(0,300000))
# -*- coding: utf-8 -*-
import numpy as np

r = int(input())

ans = r * 2 * np.pi()

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
#import numpy as np

r = int(input())

ans = r * 2 * 3.14159265

print(ans)
s,t = str(input())
print(t+s)

### FIXED CODE ###

s,t = str(input()).split()
print(t+s)
N,M = input().split()
result = int(N*(N-1)/2) + int(M*(M-1)/2)
print(result)

### FIXED CODE ###

a,b = map(int, input().split())
 
c = a*(a-1)//2 + b*(b-1)//2
print(c)
N, L = map(int, input().split())
list=[]
for i in range(N):
    list.append(str(input()))
print("".join(sorted.list()))

### FIXED CODE ###

# 入力
N,L=map(int,input().split())

l=[]
for i in range(N):
  l.append(input())

# ソート
l.sort()

# 出力
print(''.join(l))
from heapq import (
    heapify,  # 優先度付きキューの生成
    heappop,
    heappush,
    heappushpop,
    heapreplace
    )

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

#heapqは最小値しか取り出さないので-1倍する
A = heapify([-i for i in map(int,input().split())])

for _ in range(M):
    s = -heappop(A)
    s //= 2
    heappush(A, -s)

print(-sum(A))

### FIXED CODE ###

from heapq import (
    heapify,  # 優先度付きキューの生成
    heappop,
    heappush,
    heappushpop,
    heapreplace
    )

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

#heapqは最小値しか取り出さないので-1倍する
A = [-i for i in map(int,input().split())]
heapify(A)

for _ in range(M):
    s = -heappop(A)
    s //= 2
    heappush(A, -s)

print(-sum(A))
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576475000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

### FIXED CODE ###

X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y==576460752303423487:
  print(59)
  exit()
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)
#!/usr/bin/env python3

S = int(input())

if (S[0] == S[1] and S[1]== S[2]):
    print("No")
else:
    print("Yes")


### FIXED CODE ###

#!/usr/bin/env python3

S = str(input())

if (S[0] == S[1] and S[1]== S[2]):
    print("No")
else:
    print("Yes")
n, m, k = [int(_) for _ in input().split()]

a = [int(_) for _ in input().split()]
b = [int(_) for _ in input().split()]

b.append(k)
cnt = 0
ans1, ans2 = 0, 0
for i in range(n-1):
    a[i+1] += a[i]
    if a[i] <= k:
        ans1 = i

for j in range(m):
    b[j+1] += b[j]
    if b[i] <= k:
        ans2 = j
# print(a, b)
ans = max(ans1, ans2)
for i in range(n):
    nokori = k-a[i]
    if nokori < 0:
        break
    if b[0] > nokori:
        ans = max(i+1, ans)
        continue

    r, l = 0, m

    while(l-r > 1):
        if b[(r+l)//2] <= nokori:
            r = (r+l)//2
        else:
            l = (r+l)//2
        # print(l, r)
    ans = max(i+l+1, ans)
    # print(i, r, l, nokori)
print(ans)


### FIXED CODE ###

n, m, k = [int(_) for _ in input().split()]

a = [int(_) for _ in input().split()]
b = [int(_) for _ in input().split()]

b.append(k+100)
cnt = 0
ans1, ans2 = 0, 0
for i in range(n-1):
    a[i+1] += a[i]
    if a[i+1] <= k:
        ans1 = i+2
for j in range(m-1):
    b[j+1] += b[j]
    if b[j+1] <= k:
        ans2 = j+2
# print(a, b)
ans = max(ans1, ans2)
for i in range(n):
    nokori = k-a[i]
    r, l = 0, m
    if nokori < 0:
        break
    if b[0] > nokori:
        ans = max(i+1, ans)
        continue

    while(l-r > 1):
        if b[(r+l)//2] <= nokori:
            r = (r+l)//2
        else:
            l = (r+l)//2
        # print(l, r)
    ans = max(i+l+1, ans)
    # print(i, r, l, nokori)
print(ans)
MOD = int(1e9) + 7
MAX = int(1e6) + 7


def div(a, b):
    return a * pow(b, MOD-2, MOD) % MOD


FACT = [1] * (MAX+1)
for i in range(1, MAX+1):
    FACT[i] = (i * FACT[i-1]) % MOD
INV = [1] * (MAX+1)
INV[MAX] = div(1, FACT[MAX])
for i in range(MAX, 0, -1):
    INV[i-1] = (INV[i] * i) % MOD


def combination(m, n):
    return (FACT[m] * INV[n] * INV[m-n]) % MOD


def main():
    K = int(input())
    S = input()
    N = len(S)
    pow25 = [1] * (K+1)
    pow26 = [1] * (K+1)
    for i in range(K):
        pow25[i+1] = (pow25[i] * 25) % MOD
        pow26[i+1] = (pow26[i] * 26) % MOD
    ans = 0
    for m in range(N, N+K+1):
        tmp = (combination(m-1, N-1) * pow25[m-N] * pow26[N+K-m]) % MOD
        ans = (ans + tmp) % MOD
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

MOD = int(1e9) + 7
MAX = int(2e6) + 7


def div(a, b):
    return a * pow(b, MOD-2, MOD) % MOD


FACT = [1] * (MAX+1)
for i in range(1, MAX+1):
    FACT[i] = (i * FACT[i-1]) % MOD
INV = [1] * (MAX+1)
INV[MAX] = div(1, FACT[MAX])
for i in range(MAX, 0, -1):
    INV[i-1] = (INV[i] * i) % MOD


def combination(m, n):
    return (FACT[m] * INV[n] * INV[m-n]) % MOD


def main():
    K = int(input())
    S = input()
    N = len(S)
    pow25 = [1] * (K+1)
    pow26 = [1] * (K+1)
    for i in range(K):
        pow25[i+1] = (pow25[i] * 25) % MOD
        pow26[i+1] = (pow26[i] * 26) % MOD
    ans = 0
    for m in range(N, N+K+1):
        tmp = (combination(m-1, N-1) * pow25[m-N] * pow26[N+K-m]) % MOD
        ans = (ans + tmp) % MOD
    print(ans)


if __name__ == "__main__":
    main()
N = int(input())

for i in range(1,10):
    for j in range(1,10):
        if i * j == N:
            print("Yes")
            quit()
print("No")


### FIXED CODE ###

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

if a > 9 or b > 9:
    print(-1)
else:
    print(a*b)
def resolve():
    import itertools
    import numpy as np

    n = int(input())
    A = np.asarray(list(map(int, input().split())))
    s = sum(A)
    print((s**2 - sum(A**2))//2 % (10**9 + 7))

resolve()

### FIXED CODE ###

def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    sm = sum(A) % (10**9 + 7)

    ans = 0
    for a in A:
        sm -= a
        ans += sm * a
        ans %= (10**9 + 7)
    print(ans)

resolve()
n=int(input())
w=list(map(int,input().split()))
m=sum(w)
for i in range(n)m=min(m,abs(sum(w[:i+1])-sum(w[i+1:])))
print(m)

### FIXED CODE ###

n=int(input())
w=list(map(int,input().split()))
m=sum(w)
for i in range(n):m=min(m,abs(sum(w[:i+1])-sum(w[i+1:])))
print(m)
def main():
    K=int(input())
    (A,B)=[int(x) for x in input().split()]
    if A % K == 0:
        print('OK')
    elif math.ceil(A/K)*K <= B:
        print('OK')
    else:
        print('NG')
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

import math

def main():
    K=int(input())
    (A,B)=[int(x) for x in input().strip().split()]
    if A % K == 0:
        print('OK')
    elif math.ceil(A/K)*K <= B:
        print('OK')
    else:
        print('NG')
 
if __name__ == '__main__':
    main()
n = int(input())
a = [int(i) for i in input().split()]


l = [0] * max(a)


for i in a:

    c = 2
    while True:
        if i*c-1 >= max(a):
            break
        l[i*c - 1] += 1
        c += 1



ans = 0

for i in set(a):
    if l[i] == 1:
        ans += 1

print(ans)


### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
 
maxA = max(A)
ans = 0
flag = [0]*(maxA+1)
 
# print(flag)
for a in A:
    for ax in range(a,maxA+1,a):
        flag[ax] +=1
 
# print(flag)
for a in set(A):
    if flag[a] == 1:
        ans += 1
print(ans)
X = int(input())

se = set()
for n in range(32):
    for e in range(2,11):
        if n**e <= X:
            se = set(n**e)

answer = max(se)
print(answer)

### FIXED CODE ###

X = int(input())
se = set(n**e for n in range(32) for e in range(2,11) if n**e <= X)

answer = max(se)
print(answer)
n =int(input())
import math
ans = 1
for _ in range(n):
    t = int(input())
    ans = ans * t // math.gcd(ans, t)
print(ans)

### FIXED CODE ###

n =int(input())
import fractions
ans = 1
for _ in range(n):
    t = int(input())
    ans = ans * t // fractions.gcd(ans, t)
print(ans)
# -*- coding: utf-8 -*-


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
if 2 not in a:
    print(-1)
else:
    cnt = 0
    before_num = 1
    lighted_bottons = [0 for i in range(n)]
    while True:
        cnt += 1
        if a[before_num - 1] == 2:
            print(cnt)
            break
        else:
            if lighted_bottons[a[before_num - 1]] == 1:
                print(-1)
                break
            before_num = a[before_num - 1]
            lighted_bottons[before_num] = 1

### FIXED CODE ###

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


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
if 2 not in a:
    print(-1)
else:
    cnt = 0
    before_num = 1
    lighted_bottons = [0 for i in range(n + 1)]
    while True:
        cnt += 1
        if a[before_num - 1] == 2:
            print(cnt)
            break
        else:
            if lighted_bottons[a[before_num - 1]] == 1:
                print(-1)
                break
            before_num = a[before_num - 1]
            lighted_bottons[before_num] = 1
import math

A,B = input().split()

print(math.ceil((B-1)/(A-1)))

### FIXED CODE ###

import math
A,B = input().split()
A = int(A)
B= int(B)
print(str(math.ceil((B-1)/(A-1))))
N = int(input())
*A, = map(int, input().split())
print(A)
B = []
for i in A:
  if i % 2 == 0:
    B.append(i)
C = 0

for l in B:
  if l % 5 == 0 or l % 3 == 0:
    C = C + 1
 
if C/len(B) == 1:
  print('APPROVED')
else:
  print('DENIED')



### FIXED CODE ###

N = int(input())
*A, = map(int, input().split())
B = []
C = 0
for i in A:
  if i % 2 == 0:
    B.append(i)
    if i % 5 == 0 or i % 3 == 0:
      C += 1
 
if C == len(B):
  print('APPROVED')
else:
  print('DENIED')
n, q = map(int, input().split(' '))
inf = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split(' '))
    inf[a-1].append(b-1)
    inf[b-1].append(a-1)
score = [0 for _ in range(n)]
visit = [0 for _ in range(n)]
for _ in range(q):
    p, x = map(int, input().split(' '))
    score[p-1] += x
def addp(num):
    if all(visit[x] == 1 for x in inf[num]):
        return 0
    for i in inf[num]:
        if visit[i] == 0:
            score[i] += score[num]
            visit[i]  = 1
    for i in inf[num]:
        addp(i)
    return 0
visit[0] = 1
addp(0)
print(*score)

### FIXED CODE ###

def main():
    n, q = map(int, input().split(' '))
    import sys
    from collections import deque
    sys.setrecursionlimit(10**7)

    visit = [True for _ in range(n)]
    point = [0 for _ in range(n)]
    dic = [[] for _ in range(n)]
    for _ in range(n-1):
        a, b = map(int, input().split(' '))
        dic[a-1].append(b-1)
        dic[b-1].append(a-1)
    for _ in range(q):
        p, x = map(int, input().split(' '))
        point[p-1] += x
    next_visit = deque()
    next_visit.append(0)
    visit[0] = False
    counter = 1
    while counter < n:
        t = next_visit.pop()
        for s in dic[t]:
            if visit[s]:
                point[s] += point[t]
                visit[s] = False
                counter += 1
                next_visit.append(s)
    print(*point)
if __name__ == '__main__':
    main()
a,p=input().split()

print(int((a*3+p)/2))

### FIXED CODE ###

import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from copy import copy
import numpy as np
from numpy.fft import fft, ifft
from fractions import gcd


def input(): return sys.stdin.readline().strip()


def INT(): return int(input())


def MAP(): return map(int, input().split())


def LIST(): return list(map(int, input().split()))


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a, p = MAP()

print(int((a*3+p)/2))
a, b = map(int,input())

if (a + b) < 25:
  print(a + b)

else:
  print((a + b) - 24)
  


### FIXED CODE ###

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

print((a + b) % 24)
from collections import deque
import copy
import sys
import numpy as np
sys.setrecursionlimit(410000)

INF = 10**6

h,w = map(int,input().split())
org_maze = [list(input()) for _ in range(h)]

def solve(sy,sx):
  d = [[INF]*w for _ in range(h)]
  for i in range(h):
    for j in range(w):
      if maze[i][j] == '#':
        d[i][j] = -INF          
  
  que = deque()
  que.append([sx,sy])
  d[sy][sx]=0

  while len(que)>0:
    px,py = que.popleft()

    for dx,dy in ((-1,0),(0,1),(1,0),(0,-1)):
      nx = px + dx
      ny = py + dy

      if (0 <= nx and nx < w and 0<=ny and ny < h) \
          and maze[ny][nx] != '#' \
          and (d[ny][nx] == INF or d[ny][nx] > d[py][px] +1):              
        que.append((nx,ny))
        d[ny][nx] = d[py][px] +1

  return d

ans = 0
for sy in range(h):
  for sx in range(w):
    maze = copy.deepcopy(org_maze)
    if maze[sy][sx] == '.':
      f = solve(sy,sx)
      ans = max(ans, np.max(np.array(f)))
    
print(ans)    

### FIXED CODE ###

from collections import deque
import copy
import sys
#import numpy as np
sys.setrecursionlimit(410000)

INF = 10**6

h,w = map(int,input().split())
org_maze = [list(input()) for _ in range(h)]

def solve(sy,sx):
  d = [[INF]*w for _ in range(h)]
  for i in range(h):
    for j in range(w):
      if maze[i][j] == '#':
        d[i][j] = -INF          
  
  que = deque()
  que.append([sx,sy])
  d[sy][sx]=0

  while len(que)>0:
    px,py = que.popleft()

    for dx,dy in ((-1,0),(0,1),(1,0),(0,-1)):
      nx = px + dx
      ny = py + dy

      if (0 <= nx and nx < w and 0<=ny and ny < h) \
          and maze[ny][nx] != '#' \
          and (d[ny][nx] == INF or d[ny][nx] > d[py][px] +1):              
        que.append((nx,ny))
        d[ny][nx] = d[py][px] +1

  return d

ans = 0
for sy in range(h):
  for sx in range(w):
    maze = copy.deepcopy(org_maze)
    if maze[sy][sx] == '.':      
      f = solve(sy,sx)      
      for i in range(h):        
        ans = max(ans,max(f[i]))
          
print(ans)
import math
from functools import reduce


def MinB(x, y):
    return (x * y) // math.gcd(x, y)

def MinB_list(numbers):
    return reduce(MinB, numbers, 1)

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

tmp = MinB_list(AList)
result = 0
for i in range(0, N):
    result += tmp // AList[i]
    
print(result % (10 ** 9 + 7))

### FIXED CODE ###

import fractions
from functools import reduce


def MinB(x, y):
    return (x * y) // fractions.gcd(x, y)

def MinB_list(numbers):
    return reduce(MinB, numbers, 1)

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

tmp = MinB_list(AList)
result = 0
for i in range(0, N):
    result += tmp // AList[i]
    
print(result % (10 ** 9 + 7))
import numpy as np

n = int(input())
a = list(map(int, input().split()))
zenbu = sum(a)
ans = 0

for i in range(n):
  ans += a[i]*(zenbu-a[i])
 
print(ans // 2 % (1000000000+7))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
zenbu = sum(a)
ans = 0

for i in range(n):
  ans += a[i]*(zenbu-a[i])
 
print(ans // 2 % 1000000007)
n = int(input())
ones = n % 10

if n == 3:
    print('bon)
elif n in [0,1,6,8]:
    print('pon')
else:
    print('hon')


### FIXED CODE ###

n = int(input())
ones = n % 10

if ones == 3:
    print('bon')
elif ones in [0,1,6,8]:
    print('pon')
else:
    print('hon')
K = map(int, input().split())
if K%2 ==0:
    print((K/2) ** 2)
else:
    print((K**2 - 1)/4)


### FIXED CODE ###

k=int(input())
if (k%2)==1 and k<=100:
    a=k//2
    b=k//2+1
elif (k%2)==0 and k<=100:
    a=k//2
    b=k//2
print(a*b)
while True:
    H,W =  [int(i)for i in input.split()]
    if H == W ==0:
        break


    for h in range(H):
        for w in range(w):
            if (h + w) % 2 == 0:
                print('#', end='')
            

### FIXED CODE ###

while True:
    h, w = map(int, input().strip().split())
    if h == w == 0: break
    for y in range(h):
        print(''.join('#.'[(x + y) % 2] for x in range(w)))
    print()
from itertools import combinations
import copy
H,W,K = map(int,input().split())
cs = [list(input()) for i in range(H)]
HC = [i for i in range(H)]
WC = [i for i in range(W)]
cBlackCount=0
c=0
for i in range(H+1):
  for j in range(W+1):
    for selectRows in combinations(HC,i):
      for selectCols in combinations(WC,j):
        cBlackCount=fBlackCount
        for m in range(H):
          for n in range(W):
            if cs[m][n] == '#':
              if m in selectRows or n in selectCols:
                cBlackCount+=1
        if cBlackCount == K:
          c+=1
print(c)
          
  


### FIXED CODE ###

from itertools import combinations
import copy
H,W,K = map(int,input().split())
cs = [list(input()) for i in range(H)]
HC = [i for i in range(H)]
WC = [i for i in range(W)]
fBlackCount=0
for i in range(H):
  fBlackCount += cs[i].count('#')
cBlackCount=fBlackCount
c=0
for i in range(H+1):
  for j in range(W+1):
    for selectRows in combinations(HC,i):
      for selectCols in combinations(WC,j):
        #print(selectRows)
        #print(selectCols)
        cBlackCount=fBlackCount
        for m in range(H):
          for n in range(W):
            if cs[m][n] == '#':
              if m in selectRows or n in selectCols:
                cBlackCount-=1
        if cBlackCount == K:
          #print(i)
          #print(j)
          #print(selectRows)
          c+=1
print(c)
N,K = map(int, input().split())
p = list(map(int, input().split()))

sum_memo = [0]*1001
x_memo = [0] * 1000
x_list = [0]*N

for i in range(1,1001):
    sum_memo[i] = sum_memo[i-1] + i

for i in range(N):
    if x_memo[p[i]] == 0:
        x_memo[p[i]] = sum_memo[p[i]]/p[i]
    x_list[i] = x_memo[p[i]]


ans = 0
tmp = sum(x_list[:K])
for l in range(N-K):
    r = l+K
    tmp = tmp -  x_list[l] + x_list[r]
    ans = max(ans, tmp)
print(ans)


### FIXED CODE ###

N,K = map(int, input().split())
p = list(map(int, input().split()))

sum_memo = [0]*1001
x_memo = [0] * 1001
x_list = [0]*N

for i in range(1,1001):
    sum_memo[i] = sum_memo[i-1] + i

for i in range(N):
    if x_memo[p[i]] == 0:
        x_memo[p[i]] = sum_memo[p[i]]/p[i]
    x_list[i] = x_memo[p[i]]


ans = 0
tmp = sum(x_list[:K])
#print(tmp)
#print(x_list)
if N==K:
    print(tmp)
    exit()
for l in range(N-K):
    r = l+K
    tmp = tmp -  x_list[l] + x_list[r]
#    print(l,r,x_list[l], x_list[r], tmp)
    ans = max(ans, tmp)
print(ans)
import itertools
N, M = [int(n) for n in input().split()]
path = [[False for i in range(M)]for j in range(M)]


for i in range(M):
    a, b = [int(n)-1 for n in input().split()]
    path[a][b] = True
    path[b][a] = True


res = 0
for way in itertools.permutations(range(1,N), N-1):
    exist = True
    if path[0][way[0]] == False:
        exist = False
    for n in range(N-2):
        if path[way[n]][way[n+1]] == False:
            exist = False
    if exist == True:
        res += 1

print(res)


### FIXED CODE ###

import itertools
N, M = [int(n) for n in input().split()]
path = [[False for i in range(N)]for j in range(N)]


for i in range(M):
    a, b = [int(n)-1 for n in input().split()]
    path[a][b] = True
    path[b][a] = True


res = 0
for way in itertools.permutations(range(1,N), N-1):
    exist = True
    if path[0][way[0]] == False:
        exist = False
    for n in range(N-2):
        if path[way[n]][way[n+1]] == False:
            exist = False
    if exist == True:
        res += 1

print(res)