peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
input_str = input().split()

input_nums=[]

for i in range(5):
    input_nums.append(int(input_str[i]))


diff_hour = input_nums[2] - input_nums[0]
diff_hour_to_min = diff_hour * 60
 
diff_min = input_nums[3] - input_nums[1]

total_wake_min = diff_hour_to_min + diff_min

print(total_wake_min - input_nums[4])
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]

k = 1
S = 0

for a in A:
    if k == a:
        S += 1
        k += 1
if S:
    print(N-S)
else:
    print(-1)
# Judge status: Accepted
S = input()

prev = ""
curr = ""
ans = 0
for s in S:
    curr += s
    if (prev != curr):
        prev = curr
        curr = ""
        ans += 1

print(ans)
# Judge status: Wrong Answer
a = []
for i in range(3):
  a.append(list(map(int,input().split())))
for i in range(int(input())):
  b = int(input())
  for j in range(3):
    for k in range(3):
      if a[j][k] == b:
        a[j][k] = 0
def bingo():
  for i in range(3):
    if sum(a[i]) == 0 or a[0][i] + a[0][j] + a[0][k] == 0:
      return 'Yes'
  if a[0][0] + a[1][1] + a[2][2] == 0 or a[0][2] + a[1][1] + a[2][0] == 0:
    return 'Yes'
  return 'No'
print(bingo())
# Judge status: Accepted
A,B=map(int,input().split())
if A%B==0:
    print(0)
else:
    print(1)
# Judge status: Accepted
n = int(input())
SP = []
for i in range(n):
    s, p = input().split()
    SP += [[s,int(p),i+1]]
SP.sort(key=lambda A:(A[0],-A[1]))
for sp in SP:
	print(sp[2])
# Judge status: Accepted
S = input()
n = [0]*(len(S)+1)

if S[0]=='<':
    n[0]==0
for i in range(0,len(S)):
    if S[i]=='>':
        n[i+1]=0
    else:
        n[i+1]=n[i]+1
        
for i in range(len(S)-1,-1,-1):
    if S[i]=='>':
        n[i]=max(n[i],n[i+1]+1)
        
print(sum(n))
# Judge status: Accepted
import sys
n, y = map(int, input().split())
for a in range(n+1):
    for b in range(n+1-a):
        if 10000 * a + 5000 * b + 1000 * (n - a - b) == y:
            ans = [a, b, n - a - b]
            print(*ans, sep=" ")
            sys.exit()
    
print("-1 -1 -1")
# Judge status: Accepted
Row = int(input())
List = [input() for i in range(Row)]
print(len((set(List))))
# Judge status: Accepted
n = int(input())
h = [int(i) for i in input().split()]
max_cnt, cnt = 0, 0
for i in range(n - 1):
    if h[i] >= h[i + 1]:
        cnt += 1
    else:
        cnt = 0
    max_cnt = max(max_cnt, cnt)
print(max_cnt)
# Judge status: Accepted
S = input()
if len(S) == len(set(S)):
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
n = int(input())

if n % 2 != 0:
    print(0)
elif n == 0:
    print(1)
else:
    ans = 0
    for i in range(1, 100):
        ans += n//(5**i*2)
    print(ans)
# Judge status: Wrong Answer
from itertools import combinations
from math import sqrt

# input
N = int(input())
xy = []
append = xy.append
for n in range(N):
    x, y = map(int, input().split())
    append((x, y))

nC2 = list(combinations(xy, 2))
dist = 0
for a, b in nC2:
    dist += sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)

print(dist / len(nC2))
# Judge status: Accepted
from sys import stdin, stdout
input = stdin.readline
print = stdout.write
from functools import reduce
n, k = map(int,input().split())
a = list(map(int,input().split()))
prod = a[0]
ans = []
for i in range(k,n):
    prod = a[i-k]
    prodt = a[i]
    if prodt>prod:
        ans.append('Yes')
    else:
        ans.append('No')
ans = '\n'.join(ans)
print(ans)
# Judge status: Accepted
# N = int(input())

# power = 1
# for i in range(1, N+1):
#    power *= i
# print(power % (10 ** 9 + 7))

# TLEとなってしまう
# modの世界を使う

N = int(input())
power = 1
for i in range(1, N+1):
    power = power * i % (10 ** 9 + 7)

print(power)
# Judge status: Accepted
line = input().split()
N = int(line[0])
nB = int(line[1])
nR = int(line[2])

if nB == 0:
  print(0)
  quit()

nball = nB + nR
nGroup = N // nball
nAdditional = N % nball

if nAdditional > nB:
  nAdditional = nB

nBlueTotal = nB * nGroup + nAdditional
print(nBlueTotal)
# Judge status: Accepted
n = int(input())

a = [0]*n

for i in range(n):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        a[i] = 1
ans = 'No'        
for i in range(n-2):
    if a[i]*a[i+1]*a[i+2] ==1:
        ans = 'Yes'
        
print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python3
import sys

def main():
    D, N = map(int, input().split())
    print((100**D)*N)
    return

if __name__ == '__main__':
    main()
# Judge status: Accepted
X, K, D = map(int, input().split())
a, b = abs(X)//D, abs(X)%D
if K <= a:
  if X >= 0:
    ans = X - K*D
  else:
    ans = X + K*D
else:
  K = (K - a) % 2
  if X >= 0:
    ans = X - a*D
  else:
    ans = X + a*D
  if K == 1:
    if abs(X+D) < abs(X-D):
      ans += D
    else:
      ans -= D
print(abs(ans))
# Judge status: Accepted
s = input()
s = set(s)
alpha = set([chr(ord('a')+i) for i in range(26)])
alpha -= s
alpha = list(alpha)
alpha.sort()
if len(alpha) == 0:
    print('None')
else:
    print(alpha[0])
# Judge status: Wrong Answer
s = input()
k = int(input())
alp = 'bcdefghijklmnopqrstuvwxyza'
for i in range(len(s)):
    t = alp.index(s[i])
    if k >= 25-t:
        s = s[:i] + 'a' + s[i+1:]
        k -= 25-t
    elif i == len(s)-1:
        s = s[:i] + alp[k+t%26]
print(s)
# Judge status: Wrong Answer
import sys

N=int(input())
s=[int(input()) for i in range(N)]
num=sum(s)

if num%10!=0:
    print(num)
else:
    for i in range(N):
        s=sorted(s)
        if s[i]%10==0:
            continue
        else:
            print(num-s[i])
            sys.exit()

if len(s)==0:
    print(0)
# Judge status: Accepted
N = int(input())
flag = False
for i in range(1,10):
	if(N%i==0):
		if((10-(N//i))>=1):
			flag =True
			break
if flag:
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
c = input()
if c in alf:
    print("a")
else:
    print("A")
# Judge status: Accepted
n = int(input())
w = list(list(map(int, input().split())))
ans = []
for t in range(n):
  absolute = abs(sum(w[:t])-sum(w[t:]))
  ans.append(absolute)
print(min(ans))
# Judge status: Wrong Answer
x,y = map(int,input().split())
if x == y:
  print(-1)
else:
  print(x * 2)
# Judge status: Wrong Answer
N,K = map(int,input().split())
A = list(map(int,input().split()))

P = K - 1
print(N // P)
# Judge status: Wrong Answer
x,y = map(int, input().split())

if abs(x) > abs(y):
  x,y = y,x

ans = abs(y)-abs(x)

if x>0 and y<0:
  ans += 1
elif x<0 and y>0:
  ans += 1
elif x<0 and y<0:
  ans += 2

print(ans)
# Judge status: Wrong Answer
import sys
 
N = int(sys.stdin.readline())
if N == 0:
    print(0)
    sys.exit()
binN = ""
pN = abs(N)
while N != 0:
    if abs(N % -2) == 1:
        binN += "1"
    else:
        binN += "0"
    N //= -2
print(binN[::-1])
# Judge status: Accepted
n,m=map(int,input().split())

if n>=3 and m>=3:
  a=n*m
  b=n*2+m*2-4
  ans=a-b
elif n==1 and m==1:
  ans=1
elif n==1 or m==1:
  a=n*m
  b=2
  ans=a-b
elif n==2 or m==2:
  ans=0
  
print(ans)
# Judge status: Accepted
def combi_mod(n, r, mod):
    child = 1
    mother = 1
    for i in range(r):
        child = child * (n-i) % mod
        mother = mother * (i+1) % mod
    return child * pow(mother, mod-2, mod) % mod

n, a, b = map(int, input().split())
mod = 10**9 + 7

ans = pow(2, n, mod) - 1
ans %= mod
ans += mod - combi_mod(n, a, mod)
ans %= mod
ans += mod - combi_mod(n, b, mod)
ans %= mod
print(ans)
# Judge status: Accepted
import numpy as np 
s=input()
t=input()
for i in range(len(s)):
    s=s[-1]+s[:-1]
    if s==t:
        print("Yes")
        exit()
print("No")
# Judge status: Accepted
N=int(input())
D=list()
for i in range(N):
    tmp=list(map(int,input().split()))
    D.append(tmp[0]==tmp[1])
for i in range(N-2):
    if D[i]==D[i+1]==D[i+2]==True:
        print("Yes")
        break
else:
    print("No")
# Judge status: Wrong Answer
l = list(input())
strlen = l.__len__()
"no" if strlen - list(set(l)).__len__() else "yes"
# Judge status: Accepted
N,*A=map(int, open(0).read().split())
print(sum(sorted(A)[N::2]))
# Judge status: Accepted
n=int(input())
squre=int(n**0.5)

A=[0 for _ in range(10**6)]
for x in range(1,squre+1):
    for y in range(1,squre+1):
        for z in range(1,squre+1):
            num=x**2+y**2+z**2+x*y+y*z+z*x
            A[num] +=1

for i in range(n):
    print(A[i+1])
# Judge status: Wrong Answer
n,k=map(int,input().split())
s=input()
print(s.replace(s[k-1],s[k-1].lower()))
# Judge status: Accepted
x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
  print("A")
else:
  print("B")
# Judge status: Wrong Answer
# 最大公約数
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)


N, M = map(int, input().split())
a = tuple(map(int, input().split()))
lcm_num = a[0]
lcm_half = a[0] // 2
for i in range(1, N):
    tmp = a[i]
    lcm_num = lcm(lcm_num, tmp)
    lcm_half = lcm(lcm_half, tmp // 2)
print((M - lcm_half) // lcm_num + 1)
# Judge status: Accepted
from fractions import gcd
n = int(input())
t = [int(input()) for i in range(n)]

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

x = t[0]
for i in t[1:]:
	x = lcm(i,x)
print (x)
# Judge status: Wrong Answer
def main():
    n = int(input())
    p = list(map(int, input().split()))

    cnt = 0
    for i in range(1,n-1):
        if p[i-1] < p[i] < p[i+1]:
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N, K = map(int, input().split())
S = [s for s in input()]

S[K-1] = S[K-1].lower()
print("".join(S))
# Judge status: Wrong Answer
h=int(input())
n=len(list(bin(h)))-1
print(2**n-1)
# Judge status: Accepted
n,x,y=map(int,input().split())
li=[0]*(n-1)
num=0
for i in range(1,n+1):
    for j in range(i+1,n+1):
        num=min(j-i,abs(i-x)+abs(j-y)+1)
        li[num-1]+=1
for i in li:
    print(i)
# Judge status: Wrong Answer
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = input()
ans = 0
for i in range(N):
    if i >= K:
        if T[i] == T[i-K]:
            continue

    if T[i] == "r":
        ans += P
    elif T[i] == "s":
        ans += R
    else:
        ans += S
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

s = sum(A)
ans = float("inf")
cum = 0

for i in range(N-1):
    cum += A[i]
    ans = min(ans, abs(s - 2*cum))

print(ans)
# Judge status: Wrong Answer
S = input()
stack = []

for s in S:
  if s == "B" :
    if not stack:
      continue
    else:
      stack.pop()
      
  elif s == 0 or s==1:
    stack.append(s)
    
    
print("".join(stack))
# Judge status: Accepted
a, b, c = map(int, input().split())
count=0
while a%2==0 and b%2==0 and c%2==0:
  ah=a//2
  bh=b//2
  ch=c//2
  a=bh+ch
  b=ch+ah
  c=ah+bh
  if a==b and a==c and a%2==0:
    count=-1
    break
  else:
    count+=1
print(count)
# Judge status: Wrong Answer
import numpy as np
n,m=map(int,input().split())
A=list(map(int,input().split()))
A=sorted(A)
A=np.array(A, dtype=np.int64)
D=[]
for _ in range(m):
    b,c=map(int,input().split())
    D+=[c]*b

if len(D)>=n:
    D=D[-n:]
else:
    D+=[0]*(n-len(D))
D=np.array(sorted(D, reverse=True), dtype=np.int64)

A=np.maximum(A,D)
print(np.sum(A))
# Judge status: Wrong Answer
inputA = input()
inputB = input()
secIn = input()
sec = int(secIn)
splitA = inputA.split()
splitB = inputB.split()
curA = int(splitA[0])
a = int(splitA[1])
curB = int(splitB[0])
b = int(splitB[1])

d = curA - curB
dis = d if d > 0 else -d

result = "NO"
v = a - b
if v <= 0:
    result = "NO"
elif dis % v != 0:
    result = "NO"
elif dis / v < sec:
    result = "YES"
else:
    result = "NO"

print(result)
# Judge status: Accepted
s = input()
t = input()
anas = sorted(s)
at = sorted(t,reverse = True)

if anas < at:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
A, B, C = map(int,input().split())

if B - A == C - B:
    print("YES")
else:
    print("No")
# Judge status: Accepted
a=input()
b=input()
print('YES' if a==b[::-1] else 'NO')
# Judge status: Accepted
import fractions
def lcm(a):
    LCM = a[0]
    for i in range(1, n):
        LCM = LCM * a[i] // fractions.gcd(LCM, a[i])
    return LCM

n = int(input())
t = []
for i in range(n):
    t.append(int(input()))

print(lcm(t))
# Judge status: Accepted
a, b=map(int,input().split())
print((a+b+1)//2)
# Judge status: Accepted
a,b,c = map(int,input().split())
print(a * b // 2)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
x = e-a
if x <= 15:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(M)]

lst=set()
for a,b in AB:
    if b==N:
        lst.add(a)

for a,b in AB:
    if a==1:
        if b in lst:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")
# Judge status: Wrong Answer
import math

n,x,t= map(float, input().split())

print(math.ceil(n/x)*t)
# Judge status: Wrong Answer
a,b = [int(x) for x in input().split()]
import fractions
g = fractions.gcd(a,b)
ans = 1
flag = 0
mama = int(g**(1/2))
for i in range(2,mama+2):
    while True:
        if g%i != 0:
            break
        else:
            g = g/i
            flag = 1
    if flag == 1:
        ans += 1
    flag = 0
if b == a and ans == 1:
    ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
def solve(H):
    dp = [0]*N
    dp[0] = 0
    dp[1] = abs(H[1]-H[0])
    for i in range(2,N):
        dp[i] = min(dp[i-2]+abs(H[i]-H[i-2]),dp[i-1]+abs(H[i]-H[i-1]))
    ans = dp[-1]
    return ans
print(solve(H))
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
p=a[0]
q=0
for i in range(1,n):
  if p-q>=0:
    if a[i]>=0:
      q+=a[i]
    else:
      p+=a[i]
  else:
    if a[i]>=0:
      p+=a[i]
    else:
      q+=a[i]
if q==0:
  p-=a[n-1]
  q+=a[n-1]
print(abs(p-q))
# Judge status: Wrong Answer
import numpy as np
n=int(input())
a=np.array([int(x) for x in input().split()])
x=[]
for i in a:
	s=np.sum((a-i)*(a-i))
	x.append(s)
print(min(x))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a>12:
    print(b)
elif 13>a>5:
    print(b/2)
else:
    print(0)
# Judge status: Accepted
A, B = map(int, input().split())
n = 1
while True:
  A_ = A * n
  if A_ % B == 0:
    print(A_)
    exit()
  n += 1
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if abs(c-a)<=d or (abs(b-a)<=d and abs(c-b)<=d):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
S = list(input())

l = "("
r = ")"

t = 0
k = 0
ma = 0
for i in range(N):
  if S[i] == r:
    t += 1
  else:
    k += 1
  ma = max(ma, t - k)

A = [l] * ma + S + [r] * (ma + k - t)

print("".join(A))
# Judge status: Accepted
#coding: UTF-8
import math
N = int(input())
#print(N)

ans = [0]*10001

for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      a = x**2+y**2+z**2+x*y+y*z+z*x
      if a <=10000:
        ans[a] += 1
    
for i in range(1,N+1):
  print(ans[i])
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
O = list(input().rstrip())
E = list(input().rstrip())
ans = []
for i, j in zip(O, E):
    ans.append(i)
    ans.append(j)
print("".join(ans))
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))

odd = [a%2 for a in A].count(1)
even = N-odd

if(odd == 0):
    print(0 if P == 1 else 2**N)
else:
    print(2**(N-1))
# Judge status: Wrong Answer
def main():
    S = input()
    S = S.replace("?", "P")
    print(S)
if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
r = []
for i in range(n):
    s,p = input().split()
    p = -int(p)
    r.append([s,p,i])
a = sorted(r)
for i in range(n):
    print(a[i][2]+1)
# Judge status: Wrong Answer
n,m = map(int,input().split())
if m%n==0:
    print(int(m//n))
    exit()
else:
  a = m//n
  l = []
  for i in range(1,int(a**0.5)+1):
    if m%i==0:
      l.append(i)
      if m//i<=a:
        l.append(m//i)
  l = sorted(l)[::-1]
  if len(l)!=0:
    print(l[0])
  else:
    print(1)
# Judge status: Accepted
n,a,b=map(int,input().split())
c=n//(a+b)
d=n%(a+b)
print(a*c+min(d, a))
# Judge status: Wrong Answer
w = input()
wl = list(w)
wu = list(set(wl))
wu_len  = len(wu)
counter = 0
for wo in wu:
  if wl.count(wo) % 2 == 0:
    counter+=1
  else:
    print("No")
    break
if counter == int(wu_len):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())

a="abcdefghijklmnopqrstuvwxyz"
aa=list(a)

stra=""
kk=n
for i in range(15):
    ki=(kk-1)%26+1
    if ki!=0:
        stra=aa[ki-1]+stra    
    else:
        stra=aa[25]+stra    
    kk=(kk-ki)//26
#    print(kk,ki,stra)
    if kk==0:
        break
    
print(stra)
# Judge status: Wrong Answer
li= list(map(int, input().split()))
li.insert(1, li.pop(0))
li.insert(2, li.pop(0))
li.insert(0, li.pop(1))
print(li)
# Judge status: Wrong Answer
a = map(int, input().split())
n = sum(a)
if n <= 21:
  print('win')
else:
  print('burst')
# Judge status: Accepted
import re

n, k = input().strip().split(' ')
p = [int(x.strip()) for x in input().strip().split(' ')]
p.sort()
sum = 0
for i in range(0, int(k)):
  sum = sum + p[i]
print(sum)
# Judge status: Wrong Answer
import math
n=int(input())
m = [list(map(int, input().split())) for _ in range(n)]
ans=0

for i in range(n):
    for j in range(i+1,n):
        ans+=math.sqrt((m[i][0]-m[j][0])**2 + (m[i][1]-m[j][1])**2)
        print(ans)
print(ans*2/n)
# Judge status: Wrong Answer
n = int(input())
z = list(input() for _ in range(n))
if len(set(z)) == len(z):
  if all([z[i][-1] == z[i+1][0] for i in range(len(z)-1)]):
    print('Yes')
  else:
    print('No')
# Judge status: Accepted

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

if a <= b <= a+w:
    print(0)
elif a+w <= b:
    print(abs(b - (a+w)))
else:
    print(abs(a - (b+w)))
# Judge status: Accepted
def main():
    n = int(input())
    lucas_list = [2, 1]

    for i in range(2, n + 1):
        lucas_list.append(lucas_list[i - 1] + lucas_list[i - 2])

    print(lucas_list[-1])


if __name__ == "__main__":
    main()
# Judge status: Accepted
w, a, b = map(int, input().split())
print (max(max(a,b)-(min(a,b)+w),0))
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())
print(int((a + b) * h / 2))
# Judge status: Accepted
a,b=map(int,input().split())
if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print("0")
# Judge status: Accepted
def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    cumsum = A
    for i in range(1, N):
        cumsum[i] += cumsum[i - 1]
    ans = 10 ** 15
    for i in range(N - 1):
        ans = min([ans, abs(cumsum[i] - (cumsum[-1] - cumsum[i]))])
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
S = input()
count = 0
S_len = len(S)
for i in range(S_len*5):
    countstr = i * 2019
    count += S.count(str(countstr))
print(count)
# Judge status: Accepted
N, M = map(int, input().split())
C = [1] * N
R = [1] + [0] * (N-1)
for _ in range(M):
    x, y = map(int, input().split())
    x, y = x-1, y-1
    C[x] -= 1
    C[y] += 1
    if R[x]: R[y] = 1
    if C[x] == 0: R[x] = 0
print(sum(R))
# Judge status: Accepted
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
cnt=0
if sum(a) < x:
    print(n-1)
    exit()
for i in range(n):
    if x>=a[i]:
        cnt+=1
        x-=a[i]
    else:
        break
print(cnt)
# Judge status: Accepted
K = int(input())
from collections import deque
que=deque([1,2,3,4,5,6,7,8,9])
for i in range(K):
    x=que.popleft()
    if x%10!=0:
        que.append(10*x+(x%10-1))
    que.append(10*x+x%10)
    if x%10!=9:
        que.append(10*x+(x%10+1))
print(x)
# Judge status: Accepted

a,b,n=[int(x) for x in input().split()]
x=min((b-1),n)
f=(a*x)//b-(a*(x//b))
print(f)
# Judge status: Accepted
i = input()

san = i[2]
yon = i[3]
go = i[4]
roku = i[5]

if san == yon and go ==roku:
    print("Yes")
else:
    print('No')
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())
for _ in range(K):
    if A >= B:
        B *= 2
    else:
        C *= 2

print("Yes" if A < B < C else "No")
# Judge status: Wrong Answer
N = int(input()) 
x = N * 800 
y = N % 15 * 200 

print(x-y)
# Judge status: Wrong Answer
N = int(input())
W = [input() for i in range(N)]
print('Yes' if all(W[i+1][0] == W[i][-1] and W[i] not in W[:i] for i in range(N-1)) else 'No')
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    if a <= 0 <= b:
        print("Zero")
    elif a < 0 and (a - b + 1) % 2:
        print("Negative")
    else:
        print("Positive")


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, c = map(int, input().split())

r = a*b
if r%2 == 0:
    print(r//2)
else:
    print(r/2)
# Judge status: Wrong Answer
n = int(input())
lst1 = list(map(int,input().split()))
s = sum(lst1)
abs_ = 10**9+10
now = 0
i = 0
while True:
    now += lst1[i]
    if i >= n-1:
        break
    else:
        abs_ = min(abs_,abs(now-(s-now)))
    i += 1

print(abs_)
# Judge status: Accepted
c={}
for _ in range(int(input())):
  s=tuple(sorted(input()))
  c[s]=c.get(s,0)+1
print(sum(v*(v-1)//2 for v in c.values()))
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

ans = max(a * c, a * d, b * c, b * d)
print(ans)
# Judge status: Wrong Answer
X, Y = map(int, input().split())
mod = 10**9+7

small = min(X, Y)

plus = X+Y

if not plus%3==0:
    print(0)
else:
    row = plus//3+1
    col = Y-row+1
    l, r = 1, 1
    for c in range(col):
        l = (l*(row-1-c))%mod
        r = r*(c+1)%mod
    print((l*pow(r, mod-2, mod))%mod)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

num = 1
li = [1]
flag = [True]*n
flag[0] = False

for i in range(k):
    num = a[num-1]
    if flag[num-1]:
        li.append(num)
        flag[num-1] = False
    else:
        break

d = li.index(num)
ans = (k-d) % (len(li)-d)+d
print(li[ans])
# Judge status: Wrong Answer
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    x, y = map(int, input().split())

    r1 = abs(-x - -y) + 2
    r2 = abs(x - - y) + 1
    r3 = abs(-x - y) + 1
    r4 = abs(x - y)
    r = min(r1, r2, r3, r4)
    print(r)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]

ans=0
MOD= 1000000007

c=[0]*(n+1)
c[0]=1
if 1 in a:
    c[1]=0
else:
    c[1]=1

for i in range(2,n+1):
    c[i]+=(c[i-1]+c[i-2])%MOD
    if i in a:
        continue

print(c[n]%MOD)
# Judge status: Accepted
A, B = map(int, input().split())
ans = 0
tap = 0
for i in range(10000):
    if B == 1:
        break
    if i == 0:
        tap += A
        ans += 1
    if i >= 1:
        tap -= 1
        tap += A
        ans += 1
    if tap >= B:
        break
print(ans)
# Judge status: Accepted
N,M = map(int, input().split())
*H, = map(int, input().split())

V = []
for node in range(N):
    V.append(set())
for _ in range(M):
    a,b = map(int, input().split())
    V[a-1].add(b-1)
    V[b-1].add(a-1)

ans = 0
for node in range(N):
    Hi = H[node]
    flg = 0
    for next_node in V[node]:
        if Hi>H[next_node]:
            continue
        flg = 1
    if flg==0:
        ans = ans + 1
    elif len(V[node])==0:
        ans = ans + 1
print(ans)
# Judge status: Wrong Answer
s=input()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.replace("dreamer","")
s=s.replace("dream,","")
if s:
    print("NO")
else:
    print("YES")