peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
dis = abs(A-B)
mob = W-V

if B < A:
    print("No")
elif A < B:
    if mob >= 0:
        print("No")
    else:
        if dis + mob*T <= 0:
            print("Yes")
        else:
            print("No")
# Judge status: Accepted
s =input()

if s[-1] == 's':
  print(s+'es')
else:
  print(s+'s')
# Judge status: Accepted
import bisect,copy,heapq,itertools,string
from collections import *
from math import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

l,r = MAP()
if(l%2019>=r%2019) or (r-l>=2018):
  print(0)
  exit()
else:
  l %= 2019
  r %= 2019

ans = inf
for i in range(l,r):
  for j in range(i+1,r+1):
    ans = min(ans, i*j%2019)

print(ans)
# Judge status: Accepted
s,t = raw_input(), raw_input()
def f(s,t):
	cc = {}
	cr = {}
	for u,v in zip(s,t):
		if u in cc:
			if cc[u] != v: return False
		if v in cr:
			if cr[v] != u: return False
		
		cc[u] = v
		cr[v] = u
	return True
print 'Yes' if f(s,t) else 'No'
# Judge status: Accepted
s = list(input())

if s[-1] == "0" or s[-1] == "1" or s[-1] == "6" or s[-1] =="8":
    print("pon")
elif s[-1] == "3":
    print("bon")
else:
    print("hon")
# Judge status: Wrong Answer
def solve():
    x = int(input())

    l = [int(x) for x in range(1, int(x**0.5)+3)]
    for i in range(len(l)):
        if l[i]*(l[i]+1)//2 >= x:
            return i+1


print(solve())
# Judge status: Accepted
N = int(input())
X = [int(x) for x in input().split()]

y = sum(X)//N
c1 = 0
c2 = 0
for x in X:
    c1 += (x-y)**2
    c2 += (x-y-1)**2
print(min(c1, c2))
# Judge status: Accepted
l,r,d=map(int,input().split())
ans=0
for i in range(l,r+1):
    if(i%d==0):
        ans+=1
print(ans)
# Judge status: Accepted
import sys 

N = int(sys.stdin.readline().strip())
shops = []
for i in range(N):
    s, p = sys.stdin.readline().strip().split()
    shops.append((s, -1 * int(p), i+1))

for (s, p, i) in sorted(shops):
    print(i)
# Judge status: Accepted
def main():
    import sys
    N=int(sys.stdin.readline())
    A=list(map(int,sys.stdin.readline().split()))
    B=[0]*N

    money=1000
    kabu=0
    for i in range(N-1):
        if A[i]<A[i+1]:
            kabu+=money//A[i]
            money%=A[i]

        elif A[i]>A[i+1]:
            money+=kabu*A[i]
            kabu=0

    money+=kabu*A[-1]
    print(money)
    
main()
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    k, a, b = map(int, input().split())

    if b - a < 2:
        print(k + 1)
    else:
        n = k - a + 1
        res = a + n // 2 * (b - a)
        res += 1 if n % 2 != 0 else 0
        print(res)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
import math

N=int(input())
A=list(map(int,input().split()))
ans=0
tmp=0

for i in range(N-1):
    tmp+=A[i]
    ans+=tmp*A[i+1]
print(ans%((10**9)+7))
# Judge status: Accepted
a, b = list(map(int, input().split()))
if a <= 0 and b >= 0:
    print('Zero')
elif a > 0:
    print('Positive')
elif b < 0 and (b - a + 1) % 2 == 0:
    print('Positive')
else:
    print('Negative')
# Judge status: Accepted
import collections

N = int(input())
A = input().split()

c = collections.Counter(A)
cou = list(c.values())

ans = 0
for j in range(len(cou)):
	m = cou[j]
	k = m*(m-1)/2
	ans += int(k)


for i in range(N):
	x = c[A[i]]
	print(ans - x + 1)
# Judge status: Accepted
import math

N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
ans = 0
for i in range(N-1):
  for j in range(i+1, N):
    d = 0
    for k in range(D):
      d += (X[i][k] - X[j][k]) ** 2
    if int(math.sqrt(d)) ** 2 == d:
      ans += 1
print(ans)
# Judge status: Accepted
lis=sorted(list(map(int,input().split())))
lis.sort(reverse=True)
if (lis[1]-lis[2])%2==0:#偶数
    print(((lis[0]-lis[1])+(lis[0]-lis[2]))//2)
else:#奇数
    print(((lis[0]-lis[1])+(lis[0]-lis[2])+3)//2)
# Judge status: Accepted
# C - 4-adjacent
n,a = int(input()),[int(x)%4 for x in input().split()]
print("Yes" if n//2 <= a.count(0) + a.count(2)//2 else "No")
# Judge status: Wrong Answer
n, k = map(int, input().split())
result = 0

while True:
    m = abs(n - k)
    if k == 1:
        break
    elif n == 0:
        result = m
        break
    elif n <= k:
        result = min(n, m)
        break
    else:
        n = n % k

print(result)
# Judge status: Accepted
n = int(input())
s= input()
t = input()

for i in range(n):
    if s[i:]==t[:n-i]:
        print(n+i)
        exit()
print(n*2)
# Judge status: Accepted
import math
a,b = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
 
ans = 1 + int(math.ceil((a-b)/(b-1)))
print(ans)
# Judge status: Accepted
c1=list(map(int,input().split()))
c2=list(map(int,input().split()))
c3=list(map(int,input().split()))

b1,b2,b3=c1[0],c1[1],c1[2]
if c2[0]-b1==c2[1]-b2==c2[2]-b3 and c3[0]-b1==c3[1]-b2==c3[2]-b3: print('Yes')
else: print('No')
# Judge status: Accepted
a,b,c = map(int,input().split())
if b + c <= a:
    print(0)
else:
    print(c-(a-b))
# Judge status: Accepted
n=input()
print("Yes" if (n[0]=="9" or n[1]=="9") else "No")
# Judge status: Accepted
S = input()
ans = 1
prev = S[0]
i = 1

while i < len(S):
  tmp = S[i]
  while 1:
    if prev != tmp:
      break
    else:
      i += 1
      tmp += S[i]
  
  if i == len(S) - 2 and tmp == S[-1]:
    tmp += S[-1]
    i += 1
  ans += 1
  i += 1
  prev = tmp
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
num = [0 for i in range(N)]
for i in A:
    num[i-1] += 1
for l in num:
    print(l)
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))
ans = L[0]+L[N-2]
for i in range(N-2):
    ans += min([L[i],L[i+1]])
print(ans)
# Judge status: Wrong Answer
from bisect import bisect_right
a = int(input())
dp = [1]
t = 1

while t**2<=10000:
    dp.append(t**2)
    t+=1
    if dp[-1]>=a:
        print(dp[-2])
        exit()
print(dp[bisect_right(dp,a)-1])
# Judge status: Accepted
# -*- coding: utf-8 -*-
# A

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

# 再起回数上限変更
# sys.setrecursionlimit(1000000)


s = input()[:-1]

if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
# Judge status: Wrong Answer
n=int(input())
w=[int(i) for i in input().split()]
s=sum(w)
#print(s)
s2=0
for i in range(n):
    s2+=w[i]
    if s2>=s//2:
        break
print(abs((s-s2)-s2))
# Judge status: Accepted
from sys import stdin
from collections import deque
N=list(map(int,stdin.readline().strip().split()))[0]

t=0
data = [list(map(int,stdin.readline().rstrip().split())) for _ in range(N)]

data=sorted(data,key=lambda x:(x[1]))
d=deque(data)
while(len(d)!=0):
    A,B=d.popleft()
    if B>=t+A:
        t+=A
    else:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
ABCD = input()
res = 0
for i in range(1 << 3):
    l = []
    for j in range(3):
        if i >> j & 1 == 1:
            l.append(ABCD[j])
            l.append("+")
        else:
            l.append(ABCD[j])
            l.append("-")
    l.append(ABCD[-1])
    l = ''.join(l)
    res = eval(l)
    if res == 7:
        print(l + "=7")
        exit()
# Judge status: Accepted
S = input()

l = ['Sunny', 'Cloudy', 'Rainy']

index = l.index(S)

print(l[(index + 1) % 3])
# Judge status: Wrong Answer
import fractions
N, M = map(int, input().split())
A = [int(x) for x in input().split()]
ans = 0
lcm_half = 1
flag = 0
for i in range(N):
    gcd = fractions.gcd(A[i] // 2, lcm_half)
    lcm_half = (lcm_half * (A[i]) // 2) // gcd
    if lcm_half > M:
        flag = 1
        break
if flag == 1:
    ans = 0
else:
    M -= lcm_half
    ans = 1+M//(lcm_half*2)
# print(lcm_half)
print(ans)
# Judge status: Wrong Answer
def main():
    a, b, c, d = map(int, input().split())
    if abs(a-b) <= d:
        print("Yes")
    elif abs(a-c) <= d or abs(b-c) <= d:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
import math
N = int(input())
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table
print(sum(num_divisors_table(N-1)))
# Judge status: Wrong Answer
num = int(input())
ans = 0

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

yaku_list = [len(divisor(i)) for i in range(1,num+1)]

for i,j in enumerate(yaku_list):
    ans += int(i+1) * int(j)
print(ans)
# Judge status: Accepted
n=int(input())
c=list(map(int, input().split())) 

c = [0] + c
ans = 0

for i in range(1,n+1):
    if i%2 == 1 and c[i]%2 ==1:
        ans += 1

print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if b>=a:
    print(a)
else:
    print(a-1)
# Judge status: Wrong Answer
N = int(input())
l = list(map(int,input().split()))

num_odd = 0
num_even = 0
num_four = 0

for i in l:
    if i % 4 == 0:
        num_four += 1
    elif i % 2 == 0:
        num_even += 1
    else:
        num_odd += 1

if num_four <= 2 * num_odd:
    ans = "No"
else:
    ans = "Yes"
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())

ac_chk = [0]*(N+1)
wa_chk = [0]*(N+1)
wa = 0
ac = 0

for i in range(M):
	p, S = input().split()
	p = int(p)
	if ac_chk[p] == 0:
		if S == "AC":
			ac_chk[p] = 1
			ac += 1
			wa += wa_chk[p]
			continue
		if S == "WA":
			wa_chk[p] += 1
			continue
	else:
		continue
print(ac, wa)
# Judge status: Accepted
N, M = map(int, input().split())
A = []
B = []
for i in range(N):
  A.append(input())
for i in range(M):
  B.append(input())
f = 0
for i in range(N - M + 1):
  for j in range(N - M + 1):
    g = 0
    for k in range(M):
      for l in range(M):
        if A[i+k][j+l] != B[k][l]:
          g = 1
          break
      if g == 1:
        break
    if g == 0:
      print("Yes")
      f = 1
      break
  if f == 1:
    break
if f == 0:
  print("No")
# Judge status: Accepted
N = int(input())
people = [int(i) for i in input().split()]
step = 0
front = people[0]
for i in range(N):
    if front > people[i]:
        step += front - people[i]
    else:
        front = people[i]
print(step)
# Judge status: Accepted
a,b,c = map(int,input().split())
print(int(a*b/2))
# Judge status: Wrong Answer
n = int(input())
if n == 7 or n == 5 or n == 3:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
import fractions

K = int(input())
sum = 0

def gcd2(x,y,z):
    return math.gcd(math.gcd(x,y),z)

for i in range(1,K+1):
    for j in range(i,K+1):
        for k in range(j,K+1):
            if (i == j == k):
                sum += gcd2(i,j,k)
            elif i != j and j != k:
                sum += gcd2(i,j,k)*6
            else:
                sum += gcd2(i,j,k)*3



print(sum)
# Judge status: Accepted
import math

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

h = x / a / a
if a * b / 2 < a * h:
    theta = math.atan(2 * (b - h) / a)
else:
    theta = math.atan(b * b / a / h / 2)

ans = math.degrees(theta)
print(ans)
# Judge status: Accepted
s = list(input())
if s[::2].count('h') == len(s[::2]) and s[1::2].count('i') == len(s[1::2]) and len(s)%2 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,s=int(input()),input()
ans=""
for ss in s:
  if ord(ss)+n > 90:
    ans+=chr(ord(ss)+n-26)
  else:
  	ans+=chr(ord(ss)+n)
    
print(ans)
# Judge status: Wrong Answer
import sys
read_=sys.stdin.buffer.readline
x=int(read_())
print(int(-(-x/11*2//1)))
# Judge status: Wrong Answer
S=input()
T=input()
if S==T:
      print('0')
elif S!=T:
    STand = set(S) & set(T)
    STlist = list(STand )
    print(len(STlist))
# Judge status: Accepted
N, M = [int(x) for x in input().split(" ")]
next_to_1 = []
next_to_last = []

for i in range(M):
  tmp = input().split(" ")
  if int(tmp[0]) == 1:
    next_to_1.append(int(tmp[1]))
  if int(tmp[1]) == N:
    next_to_last.append(int(tmp[0]))

if len(list(set(next_to_1) & set(next_to_last))) > 0:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")
# Judge status: Wrong Answer
n = int(input())

s = len(str(n))

if s == 1:
    print(n)
elif s == 2:
    print(9)
elif s == 3:
    print(n-90)
elif s == 4:
    print(9+900)
elif s == 5:
    print(9+900+n-1000+1)
else:
    print(90909)
# Judge status: Accepted
def read_ints():
    return[int(i) for i in input().split()]

def main():
    d, n = read_ints()
    print(101 * (100**d) if n == 100 else (100**d)*n)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def gho1(x):
  g=1
  for i in range(1,x+1):
    g*=i
  return g
def gho2(x):
  g=1
  for i in range(1,x+1):
    g*=i;g=g%(10**9+7)
  return g

q,w=map(int,input().split())
e,d=divmod((2*w-q),3)
r,f=divmod((2*q-w),3)

if d!=0 or f!=0:print(0)
else:
  print((gho2(e+r)//(gho2(e)*gho2(r)))%(10**9+7))
# Judge status: Wrong Answer
print("YENOS"[int(input()[::2])%4>0::2])
# Judge status: Wrong Answer
N = int(input())

ans = []
for i in range(1,10**6):
    if N%i == 0:
        j = N//i
        ans.append(i+j-2)
    else:
        continue

print(min(ans))
# Judge status: Accepted
a,b,c,x,y = map(int, input().split())
ab = min(a+b,2*c)
a = min(a,2*c)
b = min(b,2*c)
print((x-y)*a+y*ab if x>y else (y-x)*b+x*ab)
# Judge status: Accepted
n=int(input())
a=[int(input()) for i in range(5)]
m=min(a)
k=(n+m-1)//m
print(5+k-1)
# Judge status: Accepted
_=int(input())
a=list(map(int,input().split()))
bool=True
for i in a:
    if i%2==0:
        if i%3==0 or i%5==0:
            pass
        else:
            bool=False
if bool:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Accepted
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
#import numpy as np
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())

S = str(input())

if len(S)%2 == 1 :
  print ("No")
  exit()
else :
  c = len(S)//2
  st = ""
  for _ in range(c) :
    st += "hi"
  if S == st :
    print ("Yes")
  else :
    print ("No")
# Judge status: Accepted
N=int(input())
X=[list(map(int,input().split())) for i in range(N)]
print(2/N*sum([sum([(l-m)**2for l,m in zip(X[i],X[j])])**0.5for j in range(N) for i in range(N) if i<j ]))
# Judge status: Accepted
import sys
from collections import Counter
M = {}
N = int(input())
ans = 0
for _ in range(N):
  S = input()
  S = ''.join(sorted(S))
  if S not in M:
    M[S] = 1
  else:
    ans += M[S]
    M[S] += 1
print(ans)
# Judge status: Wrong Answer
import sys

def solve():
    input = sys.stdin.readline
    N, M, K = map(int, input().split())
    possible = False
    for i in range(N + 1):
        for j in range(M + 1):
            black = (N - i) * M + N * (M - j)
            if black == K:
                print("Yes")
                possible = True
                break
        if possible: break
    else: print("No")

    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
x, y = list(map(int, input().split(" ")))
tmp = False
for i in range(0, x+1):
    if i * 2 + (x-i) * 4 == y:
        tmp = True
        break
if tmp:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x, y, z = input().split()
lis = [z, x, y]
print(" ".join(lis))
# Judge status: Accepted
K,X=list(map(int,input().split()))
if 500*K>=X:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))
S.sort()
ans = sum(S)
if ans % 10 != 0:
    print(ans)
    sys.exit()
for i in S:
    if i % 10 != 0:
        ans -= i
        print(ans)
        sys.exit()
print(0)
# Judge status: Wrong Answer
s,t = (i for i in input().split())
a,b = (int(i) for i in input().split())
u = input()

set = {s:a, t:b}
if u == s: set[s] -= 1
else: set[t] -= 1

for i in set.values(): print(i,end=" ")
print()
# Judge status: Wrong Answer
s = input()

#s = list(s)

mae = int(s[:2])
usi = int(s[2:])
#print(mae,usi)


if(mae >= 0 and mae <= 99 or usi >= 1 and usi <= 12):
  print("AMBIGUOUS")
elif(usi >= 0 and usi <= 99 or mae >= 1 and mae <= 12):
  print("AMBIGUOUS")
elif(mae == 0 and usi == 0):
  print("NA")
elif(mae == 0 and usi >= 12):
  print("NA")
elif(mae >= 12 and usi == 0):
  print("NA")
elif(mae >= 0 and mae <= 99 and usi >= 1 and usi <= 12):
  print("YYMM")
elif(usi >= 0 and usi <= 99 and mae >= 1 and mae <= 12):
  print("MMYY")
else:
  print("AMBIGUOUS")
# Judge status: Accepted
s, t = map(str, input().split())
a, b = map(int, input().split())
u = str(input())
if u == s:
    a -= 1
else :
    b -= 1
print (a, b)
# Judge status: Accepted
#B - Training Camp 
N = int(input())

power = 1
for i in range(1,N+1):
    power = (power*i)%(10**9+7)
print(power)
# Judge status: Wrong Answer
n = int(input())
L = [list(map(int, input().split())) for _ in range(n-1)]
for i in range(n-1):
    t = 0
    for j in range(i, n-1):
        if t <= L[j][1]:
            s = L[j][1]
        else:
            if t % L[j][1]:
                s = t + L[j][2] - (t % L[j][1])
            else:
                s = t
        t = s + L[j][0]
    print(t)
print(0)
# Judge status: Wrong Answer
S=str(input())
if S[0]==S[1] and S[2]==S[3]:
  print('Yes')
elif S[0]==S[2] and S[1]==S[3]:
  print('Yes')
elif S[0]==S[3] and S[1]==S[2]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import itertools

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

candidates = []
for check in itertools.permutations(t):
  t = 0
  for i in range(4):
    t+= -((-check[i])//10)*10
  t+=check[-1]
  candidates.append(t)

print(min(candidates))
# Judge status: Accepted
import collections

n = int(input())
c = collections.Counter(input())
for _ in range(n-1):
    sc = set(c.keys())
    nc = collections.Counter(input())
    snc = set(nc.keys())
    inter = sc & snc
    r = dict()
    for i in inter:
        r[i] = min(c[i], nc[i])
    c = r
if len(c) == 0:
    print('')
else:
    l = []
    for i in sorted(c.items(), key=lambda x: x[0]):
        l.append(i[0]*i[1])
    print(''.join(l))
# Judge status: Accepted
X = int(input())

A = range(-118,120)
B = range(-118,120)
flag = 0
for a in A:
  for b in B:
    ans = a**5 - b**5
    if ans == X:
      print("{} {}".format(a,b))
      flag=1
      break
  if flag:
    break
# Judge status: Accepted
S = str(input())

# S を abc を並び替えて作ることができるなら Yes を、そうでないなら No を出力せよ。

abc = [S[0], S[1], S[2]]
if "a" in abc and "b" in abc and "c" in abc:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
from operator import itemgetter
n = int(input())
sp = []
for i in range(n):
         s,p = input().split()
         tmp = [s,100-int(p),i]
         sp.append(tmp)
print(sp)
sp = sorted(sp,key = itemgetter(0,1))
print(sp)
for i in range(n):
         print(sp[i][2]+1)
# Judge status: Accepted
n,d = map(int,input().split())
i = 1+2*d
count = 1
while n>i:
    i = i + 2*d + 1
    count += 1
print(count)
# Judge status: Accepted
a = list(input())
b = list(input())
min_k = len(b)
for i in range(len(a)-len(b)+1):
  c = a[i:i+len(b)]
  count=0
  for k,j in enumerate(c):
    if b[k]==j:
      count+=1
        
  min_k = min(min_k,len(b)-count)

print(min_k)
# Judge status: Accepted
from collections import defaultdict
n, m = map(int, input().split())
ac_set = set()
wa_dic = defaultdict(int)
wa_cnt = 0
for i in range(m):
    p, s = input().split()
    if s == 'AC':
        ac_set.add(p)
    else:
        if p not in ac_set:
            wa_dic[p] += 1
print(len(ac_set), sum(value for key, value in wa_dic.items() if key in ac_set))
# Judge status: Accepted
s = input()

max = 0
tmp = 0

for c in s:
    if c in ['A', 'C', 'G', 'T']:
        tmp += 1
        if tmp > max:
            max = tmp
    else:
        tmp = 0

print(max)
# Judge status: Wrong Answer
k, n = map(int, input().split())
a = list(map(int, input().split()))

ans1 = a[n - 1] - a[0]

ans2 = 0
flag = 0
for i in range(n):
    if a[i] <= (k / 2):
        continue
    else:
        if flag == 0:
            ans2 += a[i - 1]
            flag = 1
        ans2 += (k - a[i])

print(min(ans1, ans2))
# Judge status: Accepted
A,B = (int(X) for X in input().split())
print(max(2*A-1,2*B-1,A+B))
# Judge status: Accepted
a,b,c,k = map(int,input().split())
print(min(a,k)-min(max(k-a-b,0),c))
# Judge status: Accepted
a = input()
A = len(a)
b = a[::-1]
b = b[:len(a)//2]
a = a[:len(a)//2]
res = 0
for i in range(A//2):

	if a[i] != b[i]:res+=1
print(res)
# Judge status: Wrong Answer
N = int(input())
A = [0 for _ in range(N)]
for i in range(N-1):
  c, s, f = map(int, input().split())
  for j in range(i+1):
    if A[j] < s:
      A[j] = s + c
    else:
      d = - (s - A[j]) // f + 1
      A[j] = s + f * d + c
for i in range(N):
  print(A[i])
# Judge status: Accepted
n = int(input())
lst = [(0,0,0)]
for i in range(n):
    t,x,y = map(int, input().split())
    lst.append((t,x,y))

for i in range(n):
    T,X,Y = lst[i+1][0]-lst[i][0],abs(lst[i][1]-lst[i+1][1]),abs(lst[i][2]-lst[i+1][2])
    if X+Y>T or (X+Y-T)%2!=0:
        print("No")
        exit()

print("Yes")
# Judge status: Accepted
s = list(input())
t = list(input())
s.sort()
t.sort(reverse = True)
s = ''.join(s)
t = ''.join(t)
if s < t:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
L, R = [int(i) for i in input().split()]
diff = R - L
ans = 2019
if diff == 1:
    x = (L * (L + 1)) % 2019
    print(min(x, ans))
else:
    for i in range(diff):
        for j in range(i + 1, diff):
            x = ((L + i) * (L + j)) % 2019
            ans = min(x, ans)
            if x == 0:
                break
    print(ans)
# Judge status: Accepted
N = list(map(str, input().rstrip()))
print(max(sum([int(i) for i in N]), 9*(len(N)-1)+int(N[0])-1))
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())
print('Yes' if C / B < A / D else 'No')
# Judge status: Accepted
x,y=1,10**9+7
for i in range(1,int(input())+1):x=x*i%y
print(x)
# Judge status: Accepted
import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(input())
  ans = 0
  if N==1:
    ans = 0
  else:
    ans = (N-1) * N//2
  print(ans)
  
if __name__ == '__main__':
  main()
# Judge status: Accepted
import math
N = int(input())
if N == 1:
    print(0)
    exit()
div = {}
for i in range(2, int(math.sqrt(N))+1):
    while N % i == 0:
        N = N // i
        if i in div:
            div[i] += 1
        else:
            div[i] = 1
    if N == 1:
        break
if N != 1:
    div[N] = 1
ans = 0
for v in div.values():
    i = 1
    while v >= i:
        v -= i
        i += 1
        ans += 1
print(ans)
# Judge status: Accepted
n, m = (map(int, input().split()))
print(abs((n-2) * (m-2)))
# Judge status: Accepted
ans=n=int(input())
s=input()
a=[0]
for i in s:
    if i==".":
        a+=[a[-1]+1]
    else:
        a+=[a[-1]]
w=s.count(".")
for i in range(n+1):
    ans=min(ans,i-a[i]+w-a[i])
print(ans)
# Judge status: Accepted
a,b,c,d = map(int,input().split())

if(a > 0 and b > 0):
    if(c <= 0 and d <= 0):
        print(a * d)
        exit()
if(c > 0 and d > 0):
    if(a <= 0 and b <= 0):
        print(c * b)
        exit()

print(max(a * c, b * d))
# Judge status: Wrong Answer
# coding: utf-8
N=int(input())
S=list(input())
c=0
L=[0]*N
L[0]=1 if S[0]=='(' else -1
for i in range(1,N):
    if S[i]=='(':
        L[i]=L[i-1]+1
    else:
        L[i]=L[i-1]-1
        
if L[N-1]<0:
    S.insert(0,'('*abs(L[N-1]))
elif L[N-1]>0:
    S.append(')'*L[N-1])

print(''.join(S))
# Judge status: Wrong Answer
X, Y, A, B, C = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
 
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
 
Z = 0
while Z < C:
  if min(p[X - 1], q[Y - 1]) < r[Z]:
    if p[X - 1] < q[Y - 1]:
      X -= 1
      Z += 1
    else:
      Y -= 1
      Z += 1
    continue
  break
 
print(sum(p[:X]) + sum(q[:Y]) + sum(r[:Z]))