Harryxun/stf_run huggingface dataset:
import sys,bisect
input=sys.stdin.readline

N=int(input())
vw=[(-1,-1)]
for i in range(N):
    vw.append(tuple(map(int,input().split())))

dp=[[0 for i in range(1001)] for i in range(2**10)]
for i in range(vw[1][1],1001):
    dp[1][i]=vw[1][0]
MAX=min(2**10,N+1)
for i in range(2,MAX):
    v,w=vw[i]
    for j in range(w):
        dp[i][j]=dp[i//2][j]
    for j in range(w,1001):
        dp[i][j]=max(dp[i//2][j],dp[i//2][j-w]+v)

for i in range(int(input())):
    v,L=map(int,input().split())
    if 2**10>v:
        print(dp[v][L])
    else:
        t=[]
        while v>=2**10:
            t.append(vw[v])
            v//=2
        n=len(t)
        temp=[[0,0] for i in range(2**n)]
        for i in range(1,2**n):
            m=i.bit_length()
            temp[i][0]=temp[i-2**(m-1)][0]+t[m-1][0]
            temp[i][1]=temp[i-2**(m-1)][1]+t[m-1][1]
        ans=0
        for i in range(2**n):
            ans=max(ans,temp[i][0]+dp[v][L-temp[i][1]]*(L>=temp[i][1]))
        print(ans)


### FIXED CODE ###

import sys,random,time,bisect
input=sys.stdin.buffer.readline

start=time.time()
N=int(input())
vw=[(-1,-1)]
for i in range(N):
    vw.append(tuple(map(int,input().split())))

dp=[[] for i in range(2**9)]
def make_dp(v):
    t=[[0,0] for i in range(15)]
    V=v
    id=0
    while v>=1:
        t[id]=vw[v]
        id+=1
        v//=2
    n=id
    temp=[[0,0] for i in range(2**n)]
    for i in range(n):
        for j in range(2**i,2**(i+1)):
            temp[j][0]=temp[j-2**i][0]+t[i][0]
            temp[j][1]=temp[j-2**i][1]+t[i][1]
    temp.sort(key=lambda x:x[1])
    for i in range(1,2**n):
        temp[i][0]=max(temp[i][0],temp[i-1][0])

    dp[V]=[0]*(10**5+1)
    for i in range(2**n-1):
        L=temp[i][1]
        R=temp[i+1][1]
        if L>10**5:
            break
        elif R>10**5:
            R=10**5+1
        for j in range(L,R):
            dp[V][j]=temp[i][0]
    else:
        L=temp[-1][1]
        if L<=10**5:
            for j in range(L,10**5+1):
                dp[V][j]=temp[-1][0]

MAX=min(2**9,N+1)
for i in range(1,MAX):
    make_dp(i)

Q=int(input())
query=[[] for i in range(N+1)]
for i in range(Q):
    v,L=map(int,input().split())
    query[v].append((L,i))

ans=[0]*Q
temp=[[0,0] for i in range(2**9)]
t=[[0,0] for i in range(15)]
def solve(v):
    V=v
    id=0
    while v>=2**9:
        t[id]=vw[v]
        id+=1
        v//=2
    n=id
    for i in range(n):
        for j in range(2**i,2**(i+1)):
            temp[j][0]=temp[j-2**i][0]+t[i][0]
            temp[j][1]=temp[j-2**i][1]+t[i][1]

    for L,ID in query[V]:
        res=0
        for i in range(2**n):
            if L>=temp[i][1]:
                res=max(res,temp[i][0]+dp[v][L-temp[i][1]])
        ans[ID]=res

for i in range(1,N+1):
    if query[i]:
        solve(i)

for i in range(Q):
    print(ans[i])
import math

A, B, C, D = map(int, input().split())

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

A_C = A // C
A_D = A // D
A_CD = A // lcm(C, D)

B_C = B // C
B_D = B // D
B_CD = B // lcm(C, D)

A_e = A - (A_C + A_D - A_CD)
B_e = B - (B_C + B_D - B_CD)

if A % C == 0 or A % D == 0:
    ans = B_e - A_e
else:
    ans = B_e - A_e + 1
print(ans)

### FIXED CODE ###

A, B, C, D = map(int, input().split())

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

A_C = A // C
A_D = A // D
A_CD = A // lcm(C, D)

B_C = B // C
B_D = B // D
B_CD = B // lcm(C, D)

A_e = A - (A_C + A_D - A_CD)
B_e = B - (B_C + B_D - B_CD)

if A % C == 0 or A % D == 0:
    ans = B_e - A_e
else:
    ans = B_e - A_e + 1
print(ans)
# -*- coding: utf-8 -*-
import sys

MAX_INT = 2**62-1
sys.setrecursionlimit(10**6)

input = sys.stdin.readline


def solve(g, f, fi, m):
    def dfs(pre, cur, memo, m):
        if (pre, cur) in memo:
            return memo[pre, cur]

        num, ways = 1, 1

        for nxt in g[cur]:
            if nxt == pre:
                continue
            n, w = dfs(cur, nxt, memo, m)
            num += n
            ways = ways * w % m * fi[n] % m

        ways = ways * f[num-1] % m
        memo[pre, cur] = num, ways
        return num, ways

    memo = {}
    print(*[dfs(None, i, memo, m)[1] for i in range(1, len(g))], sep='\n')


def main():
    n = int(input())
    g = [[] for _ in range(n+1)]
    mod = 10**9 + 7

    fact = [1] * (n+1)
    fact_inv = [1] * (n+1)

    for i in range(1, n+1):
        fact[i] = fact[i-1] * i % mod

    fact_inv[-1] = pow(fact[-1], mod-2, mod)

    for i in range(1, n)[::-1]:
        fact_inv[i] = fact_inv[i+1] * (i+1) % mod

    for _ in range(n-1):
        a, b = map(int, input().split())
        g[a].append(b)
        g[b].append(a)

    solve(g, fact, fact_inv, mod)


if __name__ == "__main__":

    main()


### FIXED CODE ###

import sys


def input() -> str:
    return sys.stdin.readline().rstrip("\r\n")


def main():
    s = input()
    if len(s) == 6 and s[-2] == s[-1] and s[2] == s[3]:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":

    main()
s = input()
l = []
for i in range(len(s)-1):
  if s[i] != s[i+1]:
    l.append(i)
a = [0] * len(s)
a[l[0]] = (l[0]+2)//2 + (l[1]-l[0])//2
a[l[0]+1] = (l[0]+1) // 2 + (l[1]-l[0]+1)//2
i = 2
while True:
  if i == len(l)-1:
    break
  a[l[i]] = (l[i]-l[i-1]+1)//2 + (l[i+1]-l[i])//2
  a[l[i]+1] = (l[i]-l[i-1])//2 + (l[i+1]-l[i]+1)//2
  i += 2
a[l[-1]] = (l[-1]-l[-2]+1)//2 + (len(s)-l[-1]-1)//2
a[l[-1]+1] = (l[-1]-l[-2])//2 + (len(s)-l[-1])//2
print(' '.join(map(str,a)))

### FIXED CODE ###

s = input()
l = []
for i in range(len(s)-1):
  if s[i] != s[i+1]:
    l.append(i)
a = [0] * len(s)
if len(l) == 1:
  a[l[0]] = (l[0]+2)//2 + (len(s)-l[0]-1)//2
  a[l[0]+1] = (l[0]+1)//2 + (len(s)-l[0])//2
  print(' '.join(map(str,a)))
  exit()
a[l[0]] = (l[0]+2)//2 + (l[1]-l[0])//2
a[l[0]+1] = (l[0]+1) // 2 + (l[1]-l[0]+1)//2
i = 2
while True:
  if i == len(l)-1:
    break
  a[l[i]] = (l[i]-l[i-1]+1)//2 + (l[i+1]-l[i])//2
  a[l[i]+1] = (l[i]-l[i-1])//2 + (l[i+1]-l[i]+1)//2
  i += 2
a[l[-1]] = (l[-1]-l[-2]+1)//2 + (len(s)-l[-1]-1)//2
a[l[-1]+1] = (l[-1]-l[-2])//2 + (len(s)-l[-1])//2
print(' '.join(map(str,a)))
N = int(input())
A = int(input())
B = int(input())

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

else:
  print(A+B)

### FIXED CODE ###

N = int(input())
 
if N==1:
  print('Hello World')
 
else:
  A = int(input())
  B = int(input())
  print(A+B)
N, K = map(int, input().split())
A = list(map(int, input().split()))

count = 1
li = []

for index, a in enumerate(A):
  for b in range(count, len(A)):
    li.append(a * A[b])

  count += 1

li.sort()

print(li[K-1])

### FIXED CODE ###

import sys

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

ans = 'Yes'

a = [A, B, C]

if len(set(a)) == 2:
  print('Yes')
else:
  print('No')
import collections

n = int(input())
a = [int(i) for i in input().split()]

dic = collections.defaultdict(int)
for i in range(n):
    dic[a[i]] += 1

ls = collections.deque()
for i in dic.keys():
    if dic[i] > 1:
        ls.append(i)

ans = n

while max(dic.values()) > 1:
    #print(dic)
    if len(ls) == 1 and dic[ls[0]] == 2:
        ans -= 2
        dic[ls[0]] -= 1
        break
    else:
        dic[ls[0]] -= 1
        dic[ls[-1]] -= 1
        ans -= 2
    if len(ls) >= 1:
        if dic[ls[0]] <= 1:
            ls.popleft()
        if dic[ls[-1]] <= 1:
            ls.pop()
print(ans)


### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]

import collections

n = int(input())
a = [int(i) for i in input().split()]

dic = collections.defaultdict(int)
for i in range(n):
    dic[a[i]] += 1

ls = collections.deque()
for i in dic.keys():
    if dic[i] > 1:
        ls.append(i)

ans = n
if len(ls) > 0:
#n/2回ループ
    for i in range(n//2):
        if len(ls) == 1 and dic[ls[0]] == 2:
            ans -= 2
            dic[ls[0]] -= 1
            break
        else:
            if len(ls) == 1:
                dic[ls[0]] -= 2
            else:
                dic[ls[0]] -= 1
                dic[ls[-1]] -= 1
            ans -= 2

        if len(ls) > 1:
            if dic[ls[-1]] <= 1:
                ls.pop()
        if dic[ls[0]] <= 1:
            ls.popleft()

        if len(ls) == 0:
            break
print(ans)
n = int(input())
h = list(map(int, input().split()))
xh = []
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
    else:
      counter = 0
print(countMax)

### FIXED CODE ###

import math
n = int(input())
h = list(map(int, input().split()))
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
  else:
    counter = 0
print(countMax)
k = int(input())
if k % 7 == 0:
    L = 9 * k / 7
else:
    L = 9 * k
out = -1
s = 10
for i in range(L):
    if s % L == 1:
        out = i + 1
        break
    else:
        s = (s % L) * 10
print(out)


### FIXED CODE ###

k = int(input())
if k % 7 == 0:
    L = 9 * k // 7
else:
    L = 9 * k
out = -1
s = 10
for i in range(L):
    if s % L == 1:
        out = i + 1
        break
    else:
        s = (s % L) * 10
print(out)
X = int(input())

import numpy as np


def judge(X):
	for a in range(int(X/100)+1):
		for b in range(int(X/100)+1):
			for c in range(int(X/100)+1):
				S = 100 * a + 101 * b + 102 * c
				d = np.arange(0, int(X/100)+1)
				e = np.arange(0, int(X/100)+1)
				f = np.arange(0, int(X/100)+1)
				DEF = np.meshgrid(d, e, f)
				Splus = 103 * DEF[0] + 104 * DEF[1] * 105 * DEF[2]
				if np.any(Splus == X - S) == True:
					return 1
	return 0

print(judge(X))

### FIXED CODE ###

X = int(input())

import numpy as np

J = np.zeros(X+1, dtype="bool")
# J[i] は、 i円の買い物ができるときにTrue, できないとFalse
J[0] = True
J[1:100] = False
J[100:106] = True
for i in range(106, X+1):
    if J[i - 100] or J[i - 101] or J[i - 102] or J[i - 103] or J[i - 104] or J[i - 105]:
        J[i] = True
    else:
        J[i] = False

if J[X] == True:
    print("1")
else:
    print("0")
li=[1,2,3]
li.pop(int(input())-1)
li.pop(int(input())-1)
print(li[0])


### FIXED CODE ###

li=[1,2,3]
li.pop(li.index(int(input())))
li.pop(li.index(int(input())))
print(li[0])
N,M = map(int,input().split())
A = list(map(int,input().split()))

if sum(A) < A:
    print(-1)
else:
    print(A - sum(A))

### FIXED CODE ###

N , M = map(int,input().split())
A = list(map(int,input().split()))
if N < sum(A):
    print(-1)
else:
    print(N - sum(A))
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int,input().split()))

a = max(A)
b = min(A)
A.pop(a)
A.pop(b)

ans = a-b
for i in range(n-2):
    ans += abs(A[i])
print(ans)

for i in range(n-2):
    if A[i] > 0:
        print(b, A[i])
        b -= A[i]
    else:
        print(a, A[i])
        a -= A[i]
print(a, b)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int,input().split()))

a, b = max(A), min(A)
for t in [a, b]:
    for i in range(len(A)):
        if A[i] == t:
            A.pop(i)
            break

ans = a-b
for i in range(n-2):
    ans += abs(A[i])
print(ans)

for i in range(n-2):
    if A[i] > 0:
        print(b, A[i])
        b -= A[i]
    else:
        print(a, A[i])
        a -= A[i]
print(a, b)
N = int(input())

G = [set() for i in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    G[a-1].add((b, c))
    G[b-1].add((a, c))

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

visited = [False] * N
visited[K-1] = True

distance = [-1]*N


def dfs(v, p, d):  # 現在の頂点v, vの親p, 現在の距離d
    distance[v-1] = d
    for i, c in G[v-1]:
        if visited[i-1] is False:
            if i == p:
                continue
            dfs(i, v, d+c)
    return


dfs(K, -1, 0)

for i in range(Q):
    x, y = map(int, input().split())
    print(distance[x-1]+distance[y-1])


### FIXED CODE ###

from collections import deque

N = int(input())

G = [set() for i in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    G[a-1].add((b, c))
    G[b-1].add((a, c))

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

visited = [False] * N
visited[K-1] = True

distance = [-1]*N

que = deque([(K, 0)])
while que:
    cur, d = que.popleft()
    distance[cur-1] = d

    for nx, nd in G[cur-1]:
        if visited[nx-1] is False:
            visited[nx-1] = True
            que.append((nx, d+nd))

for i in range(Q):
    x, y = map(int, input().split())
    print(distance[x-1]+distance[y-1])
A,B,C,D,E,F = map(int,input().split())

waters = set()
for w1 in range(0,F+1,B):
    if w1*100 > F: break
    for w2 in range(0,F+1,A):
        w = (w1+w2)*100
        if w > F: break
        waters.add(w)

sugars = set()
for s1 in range(0,F+1,D):
    if s1 > F: break
    for s2 in range(0,F+1,C):
        s = s1+s2
        if s > F: break
        if s==0: continue
        sugars.add(s)

ans_r = 0
ans_s = ans_w = None
for w in sorted(waters):
    if w > F: break
    for s in sorted(sugars):
        if w+s > F: break
        if s*100 > w*E: break
        r = 100*s/(s+w)
        if r > ans_r:
            ans_r = r
            ans_w = w
            ans_s = s
print(ans_s+ans_w, ans_s)

### FIXED CODE ###

A,B,C,D,E,F = map(int, input().split())

ws = set()
i = j = 0
while True:
    j = 0
    if B*i > F//100: break
    while True:
        w = B*i + A*j
        if w > F//100: break
        ws.add(w)
        j += 1
    i += 1
ws = list(ws)
ws.sort()

ss = set()
i = j = 0
while True:
    j = 0
    if D*i > F: break
    while True:
        s = D*i + C*j
        if s > F: break
        ss.add(s)
        j += 1
    i += 1
ss = list(ss)
ss.sort()

limit = E / (100+E)
water = A*100
sugar = rate = 0
for w in ws:
    w = w*100
    if w == 0: continue
    if w > F: break
    for s in ss:
        if w+s > F: break
        r = s / (w+s)
        if r > limit: break
        if r > rate:
            rate = r
            water = w
            sugar = s
print(water+sugar, sugar)
while True:
  try:
    a, b, c = map(int, input().split(","))
    
    rect_cnt += (a ** 2 + b ** 2 ==  c ** 2)
    dia_cnt += (a == b)

  except EOFError:
    break

print(rect_cnt)
print(dia_cnt)


### FIXED CODE ###

rect_cnt = dia_cnt = 0

while True:
  try:
    a, b, c = map(int, input().split(","))
    
    rect_cnt += (a ** 2 + b ** 2 ==  c ** 2)
    dia_cnt += (a == b)

  except EOFError:
    break

print(rect_cnt)
print(dia_cnt)
n , k = map(int, input().split())
a = list(map(int, input().split()))
neg = []
pos = []
mod = 10**9+7
for i in range(n):
    if a[i] >= 0:
        pos.append(a[i])
    else:
        neg.append(a[i])
neg.sort()
pos.sort(reverse = True)
min_num = -1
good_num = -1
if k % 2 == 1 and len(pos) == 0:
    ans = 1
    neg.sort(reverse = True)
    for i in range(k):
        ans *= neg[i]
        ans %= mod
    print(ans)
else:
    #最大化するとき
    for i in range(0,k+1,2):
        #i個だけnegから取る。
        if i > len(neg) or k - i > len(pos):
            continue
        m = 0
        if i - 1 >= 0:
            m = abs(neg[i-1])
        if k-i-1 >= 0:
            m = min(m, pos[k-i-1])
        if m > min_num:
            min_num = m
            good_num = i
    ans = 1
    for i in range(good_num):
        ans *= neg[i]
        ans %= mod
    for i in range(k - good_num):
        ans *= pos[i]
        ans %= mod
    print(ans % mod)

### FIXED CODE ###

n , k = map(int, input().split())
a = list(map(int, input().split()))
neg = []
pos = []
mod = 10**9+7
for i in range(n):
    if a[i] >= 0:
        pos.append(a[i])
    else:
        neg.append(a[i])
neg.sort()
pos.sort(reverse = True)
if (len(pos) == 0 and k % 2 == 1) or n == k:
    ans = 1
    a.sort(reverse = True)
    for i in range(k):
        ans *= a[i]
        ans %= mod
    print(ans % mod)
else:
    #最大化するとき
    from collections import deque
    ans = 1
    neg_new = []
    for i in range(0, len(neg)//2):
        neg_new.append(neg[2*i] * neg[2*i+1])
    neg_new = deque(sorted(neg_new, reverse = True))
    pos = deque(pos)
    if k % 2 == 1:
        k -= 1
        ans = pos.popleft()
    else:
        ans = 1
    while k > 0:
        if len(pos) >= 2 and len(neg_new) >= 1:
            if pos[0] * pos[1] > neg_new[0]:
                ans *= pos.popleft() * pos.popleft()
            else:
                ans *= neg_new.popleft()
        elif len(pos) >= 2:
            ans *= pos.popleft() * pos.popleft()
        else:
            ans *= neg_new.popleft()
        k -= 2
        ans %= mod
    print(ans % mod)
"""
    Author : thekushalghosh
    Team   : CodeDiggers
"""
import sys,math,cmath,time
start_time = time.time()
################# ---- USER DEFINED INPUT FUNCTIONS ---- #################
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().split()))
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
 
def solve():
  n = inp()
  if "7" in list(str(n)):
    print("YES")
  else:
    print("NO")
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
    sys.stdin = open('input.txt','r')
    sys.stdout = open('output.txt','w')
else:
    input = sys.stdin.readline
t = 1
t = inp()
for tt in range(t):
    solve()
if not ONLINE_JUDGE:
    print("Time Elapsed:",time.time() - start_time,"seconds")
sys.stdout.close()

### FIXED CODE ###

"""
    Author : thekushalghosh
    Team   : CodeDiggers
"""
import sys,math,cmath,time
start_time = time.time()
################# ---- USER DEFINED INPUT FUNCTIONS ---- #################
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().split()))
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
 
def solve():
  n = inp()
  if "7" in list(str(n)):
    print("Yes")
  else:
    print("No")
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
    sys.stdin = open('input.txt','r')
    sys.stdout = open('output.txt','w')
else:
    input = sys.stdin.readline
t = 1
for tt in range(t):
    solve()
if not ONLINE_JUDGE:
    print("Time Elapsed:",time.time() - start_time,"seconds")
sys.stdout.close()
S = list(input())
s1 = list("keyence")

x = 0
y = 0
z = 0
for i in range(len(S)):
  if S[i] == s1[x]:
    x += 1
    z = 0
  elif z != 0:
    y += 1
    z = 1


if y <= 1 and x != 0:
  print("YES")  
else:
  print("NO")

### FIXED CODE ###

S = list(input())
s1 = list("keyence")

x = []
y = []
for i in range(7):
  if S[i] == s1[i]:
    x.append(1)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(1)
  

if sum(x) + sum(y) >= 7:
  print("YES")  
else:
  print("NO")
w = input()
s = "sunny"
c = "cloudy"
r = "rainy"
if w == s:
     print(c)
elif w == c:
     print(r)
else w == r:
     print(s)

### FIXED CODE ###

w = input()

s = "Sunny"
c = "Cloudy"
r = "Rainy"
 
if w == s:
  print(c)
elif w == c:
  print(r)
else:
  print(s)
#!/usr/bin/env python3
import sys
from collections import Counter
input = sys.stdin.readline
INF = 10**9

n, k = [int(item) for item in input().split()]
a = [int(item) - 1 for item in input().split()]
cumsum = [0] * (n + 1)
for i in range(n):
    cumsum[i+1] = cumsum[i] + a[i]
    cumsum[i+1] %= k

ls = list(set(cumsum))
dic = dict()
for i, item in enumerate(ls):
    dic[item] = i

cnt = [0] * n
num = 0
ans = 0
for i, item in enumerate(cumsum):
    index = dic[item]
    ans += cnt[index]
    cnt[index] += 1
    num += 1
    if num >= k:
        left = cumsum[i - k + 1]
        index = dic[left]
        if cnt[index] > 0:
            cnt[index] -= 1
        num -= 1

print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections import Counter
input = sys.stdin.readline
INF = 10**9

n, k = [int(item) for item in input().split()]
a = [int(item) - 1 for item in input().split()]
cumsum = [0] * (n + 1)
for i in range(n):
    cumsum[i+1] = cumsum[i] + a[i]
    cumsum[i+1] %= k

ls = list(set(cumsum))
dic = dict()
for i, item in enumerate(ls):
    dic[item] = i

cnt = [0] * (n + 10)
num = 0
ans = 0
for i, item in enumerate(cumsum):
    index = dic[item]
    ans += cnt[index]
    cnt[index] += 1
    num += 1
    if num >= k:
        left = cumsum[i - k + 1]
        index = dic[left]
        if cnt[index] > 0:
            cnt[index] -= 1
        num -= 1

print(ans)
import math
print(math.celi(int(input())-1)
      

### FIXED CODE ###

import math
print(math.ceil(int(input())/2)-1)
def main():
    a,b = map(float,input().split()
    c = 100 * b
    x = a*c
    y = x%100
    z = int(x-y)
    p = z / 100
    print(int(p))
main()

### FIXED CODE ###

def main():
    from decimal import Decimal
    a,b = map(Decimal,input().split())
    print(int(a*b))
    return
main()
N,A,B = map(int,input().split())
S = 0
for i in range(2*N):
  if i%2 == 0:
    S += A
  else:
    S += B:
  if S >= N:
    if i%2 == 0:
      ans = (i-1)/2*A + N - (i-1)/2*(A+B)
    else:
      ans = i/2 * A
    break
print(ans)

### FIXED CODE ###

n, a,b = map(int, input().split())
ans = n//(a+b)*a
rem = n%(a+b)
ans+=min(a,rem)
print(ans)
n = int(input())
a = list(map(int, input().split()))

a_sorted = sorted(a)
divisible_list = [0] * 2 * 100010

for i in range(len(a)):
    # 過去にすでに同じ数字への加算があったら飛ばす
    if divisible_list[a[i]] > 2:
        continue
    for j in range(0, len(divisible_list), a[i]):
        divisible_list[j] += 1

ans = 0
for i in range(a):
    if divisible_list[a[i]] == 1:
        ans+=1
print(ans)

### FIXED CODE ###

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

a_sorted = sorted(a)
divisible_list = [0] * (max(a)+1)

for i in range(len(a)):
    for j in range(0, len(divisible_list), a[i]):
        divisible_list[j] += 1

ans = 0
for i in range(len(a)):
    if divisible_list[a[i]] == 1:
        ans+=1
print(ans)
T / X

### FIXED CODE ###

s = input().split()
T = int(s[0])
X = int(s[1])
print(T / X)
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n=int(input())
if n==1:
    ans=0
else:
    a=prime_factorize(n)
    if a==[]:
        ans=1
    else:
        ans=0
        xzen=a[0]
        count=1
        ans+=1
        for x in range(1,len(a)):
            if xzen==a[x]:
                count+=1
                if count==3 or count==6 or count==10 or count==15 or count==21 or count==28 or or count==35:
                    ans+=1
            else:
                xzen=a[x]
                count=1
                ans+=1
print(ans)

### FIXED CODE ###

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n=int(input())
if n==1:
    ans=0
else:
    a=prime_factorize(n)
    if a==[]:
        ans=1
    else:
        ans=0
        xzen=a[0]
        count=1
        ans+=1
        for x in range(1,len(a)):
            if xzen==a[x]:
                count+=1
                if count==3 or count==6 or count==10 or count==15 or count==21 or count==28 or count==36:
                    ans+=1
            else:
                xzen=a[x]
                count=1
                ans+=1
print(ans)
n, n = map(int, input().split())

print((n - 1) * (m - 1))

### FIXED CODE ###

n, m = map(int, input().split())

print((n - 1) * (m - 1))
i = 0
def printcase():
    n = input()
    print("Case ",i": " ,n)

if __name__ == "__main__":
    ret = printcase()


### FIXED CODE ###

def printcase():
    i = 1
    n = int(input())
    while n != 0:
        print("Case %d: %d" %(i ,n))
        n = int(input())
        i = i + 1
    return 0

if __name__ == "__main__":
    ret = printcase()