peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
W,a,b = map(int,input().rstrip().split(" "))
if abs(a-b) <= W:print(0)
else:print(abs(a-b) - W)
# Judge status: Wrong Answer
import fractions
a, b = map(int, input().split())
print(a * b / fractions.gcd(a, b))
# Judge status: Accepted
n = int(input())
l = [2,1]
for i in range(2,n+1):
  a = l[-1]+l[-2]
  l.append(a)
print(l[-1])
# Judge status: Wrong Answer
K = int(input())
S = input().split()
A = int(S[0])
B = int(S[1])

for i in range(A, B + 1):
    if i % K == 0:
        print("OK")
        break
        exit()
print("NG")
# Judge status: Wrong Answer
L, R = map(int, input().split())

ans = 10**9
for i in range(L, R):
    for j in range(i+1, R+1):
        tmp = (i*j) % 2019
        if tmp == 0:
            print(ans)
            exit(0)
        else:
            ans = min(ans, tmp)
print(ans)
# Judge status: Wrong Answer
N,M=map(int, input().split())
print((N+M)*(N+M-1)/2-N*M)
# Judge status: Wrong Answer
n=int(input())
if n<1000:
    print('ABC'+str(n))
else:
    print('ABD'+str(n))
# Judge status: Accepted
n = int(input())
a=n/3
print(a*a*a)
# Judge status: Wrong Answer
N, Y = map(int, input().split())

for a in range(N):
  for b in range(N):
    for c in range(N):
      if 10000 * a + 5000 * b + 1000 * c == Y and a + b + c == N:
        print(a,b,c)
        exit()
        
print(-1,-1,-1)
# Judge status: Accepted
n = int(input())
b = list(map(int, input().split()))
ans = b[0] + b[n-2]
for i in range(n-2):
    ans += min(b[i], b[i+1])
print(ans)
# Judge status: Wrong Answer
a = sorted(map(int, input().split()))[::-1]
print(sum(a[::2])-sum(a[1::2]))
# Judge status: Wrong Answer
n=int(input())

ans=0
lastk=n
for i in range(1,n+1):
    if i>=lastk:
        break
    k=n//i
    ans+=k*(k+1)//2*i
    ans+=i*(i-1)//2*(lastk+k+1)*(lastk-k)//2
    lastk=k

print(ans)
# Judge status: Wrong Answer
X, Y = map(int, input().split())

if Y%X ==0 or Y%X ==2 or Y%X ==4:
  if Y/X <= 4:
    print("Yes")
    exit()
  else:
    print("No")
    exit()

print("No")
# Judge status: Wrong Answer
N,M = map(int,input().split())
MOD = 10 ** 9 + 7

if abs(N-M) >= 2:
  print(0)
  exit()
  
N,M = max(N,M),min(N,M)
fctr_M = 1
for i in range(1,M+1):
  fctr_M *= i
  fctr_M %= MOD

ans = fctr_M * fctr_M
ans %= MOD
ans *= N
if N == M:
  ans *= 2
  ans %= MOD
else:
  ans *= N
  ans %= MOD

print(ans)
# Judge status: Accepted
N = int(input())
L = [0] * (N+1)
L[0] = 2
L[1] = 1
for i in range(2,N+1):
    L[i] = L[i-1] + L[i-2]
print(L[N])
# Judge status: Accepted
s = input()
s = s[::-1]
s = s.replace('resare','/')
s = s.replace('esare', '/')
s = s.replace('remaerd','/')
s = s.replace('maerd','/')

s = s.replace('/', '')
if len(s) == 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
A, B = map(int, input().split())


def prime_factor(n):
    d = set()
    for i in range(2, n + 1):
        if i * i > n:
            break
        while n % i == 0:
            d.add(i)
            n //= i
            
    if n != 1:
        d.add(n)
    return d

a = prime_factor(A)
b = prime_factor(B)
print(len(set(a) & set(b)) + 1)
# Judge status: Accepted
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

x, K, D = map(int, readline().split())
if x - K * D >= 0:
    print(abs(x - K * D))
elif x + K * D <= 0:
    print(abs(x + K * D))
else:
    low, high = 0, K
    while high - low > 1:
        mid = (high + low) // 2
        if x + (-K + 2 * mid) * D <= 0:
            low = mid
        else:
            high = mid
    print(min(abs(x + (-K + 2 * low) * D), abs(x + (-K + 2 * high) * D)))
# Judge status: Accepted
n=int(input())
s=input()

result = 0
for i in range(1,n):
  x = s[:i]
  y = s[i:]
  x_set = set(x)
  y_set = set(y)
  num = x_set & y_set
  result = max(result, len(num))
print(result)
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=str("a")*b
d=str("b")*a
if a>=b:
    print(d)
else:
    print(c)
# Judge status: Accepted
import collections
n=int(input())
a=list(map(int,input().split() ))
absa=[]
za=[]
for i in range(n):
    za.append(a[i]-(i+1))
#print(za)
#print(sum(za))
za.sort()
z=sum(za)
#print(z)
if n%2==1:
    b=za[n//2]
else:
    b=(za[n//2-1]+za[n//2])//2

#print(b)
for i in range(n):
    absa.append(abs(a[i]-(b+(i+1))))
#print(absa)
print(sum(absa))
# Judge status: Accepted
a,b,c = map(int,input().split())

oto = b // a
if oto <= c :
    print(oto)
elif oto > c :
    print(c)
# Judge status: Accepted
n, k = map(int, input().split())
a = [int(x) for x in input().split()]

if (n-1) % (k-1) == 0:
    print((n-1)//(k-1))
else:
    print((n-1)//(k-1)+1)
# Judge status: Accepted
from fractions import gcd

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

A, B = map(int, input().split())
print(lcm(A, B))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

c0 = c1 = c2 = 0

for i in a:
    if i % 4 == 0:
        c0 += 1
    elif i % 2:
        c1 += 1
    else:
        c2 += 1

if c2:
    if c1 <= c0:
        print('Yes')
    else:
        print('No')
else:
    if c1 <= c0 + 1:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
print(N % K)
print(1) if N % K else print(0)
# Judge status: Accepted
from sys import stdin
def main():
	readline=stdin.readline
	c,a,b=map(int,readline().split())
	print(c*a//2)
if __name__=="__main__":
	main()
# Judge status: Accepted
from math import ceil

n,x,t=map(int, input().split())
val=ceil(n/x)
#print(val)
print(t*val)
# Judge status: Accepted
s,w = map(int, input().split())

if w >= s: print("unsafe")
else: print("safe")
# Judge status: Wrong Answer
N=int(input())
T=list(int(input()) for _ in range(N))

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

l=T[0]
for t in T:
	l=l / gcd(l, t) * t
print(l)
# Judge status: Accepted
S = input()

if 'A' in S and 'B' in S:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
mod = 10**9+7
power = 1
for i in range(1,N+1):
    power = power*i%mod
print(power)
# Judge status: Wrong Answer
a,b,k=map(int,input().split())

r=range(a, b+1)
for i in sorted(set(r[:k]) or set(r[-k:])):
    print(i)
# Judge status: Accepted
N = int(input())
S = [input() for i in range(N)]
d = dict()
for s in S:
    if s in d:
        d[s] += 1
    else:
        d[s] = 1
l = sorted(d.items(), key=lambda x: x[1], reverse=True)
maxv = l[0][1]
res = []
for x in l:
    if x[1] == maxv:
        res.append(x[0])
for x in sorted(res):
    print(x)
# Judge status: Wrong Answer
N,M=map(int,input().split())
l,r=[0]*N,[0]*N
for i in range(M):
    a,b=map(int,input().split())
    if a==1:
        l[b-1]==1
    if b==N:
        r[a-1]==1
for i in range(N):
    if l[i]+r[i]==2:
        print('POSSIBLE')
        exit()
print('IMPOSSIBLE')
# Judge status: Accepted
x,a,b=map(int,input().split())
ad=abs(x-a)
bd=abs(x-b)

if ad > bd:
    print("B")
elif ad < bd:
    print("A")
# Judge status: Accepted
X = int(input())
print((21-(X//100))//2)
# Judge status: Wrong Answer
N = int(input())

if N <1000:
  print("ABC"+str(N).zfill(3))
else:
  print("ABD"+str(N-999).zfill(3))
# Judge status: Wrong Answer
n, k = map(int, input().split())
x = list(map(int, input().split()))

ans = 10 ** 9

if k == 1:
    for i in range(n):
        ans = min(ans, abs(x[i]))
elif n == k:
    ans = min(abs(x[0]-x[n-1]) + abs(x[n-1]), abs(x[0]) + abs(x[0] - x[n-1]))
else:
    for i in range(n-k):
        ans = min(ans, abs(x[i]-x[i+k-1]) + abs(x[i+k-1]), abs(x[i]) + abs(x[i] - x[i+k-1]))

print(ans)
# Judge status: Wrong Answer
N = input()
if int(N[0]) > int(N[1]) or (int(N[0]) == int(N[1]) >= int(N[2])):
    print(N[0]+N[1]+N[2])
else:
    print(str(int(N[0])+1)+str(int(N[0])+1)+str(int(N[0])+1))
# Judge status: Accepted
s = input()
l = len(s)
for i in range(l):
	for j in range(i, l):
		if s[:i] + s[j:] == "keyence":
			print("YES")
			exit()
else:
	print("NO")
# Judge status: Wrong Answer
x = int(input())
if x:
    print(1)
else:
    print(0)
# Judge status: Accepted
n,k=map(int,input().split())
x=list(map(int,input().split()))
mi=10**10
for i in range(n-k+1):
    mi=min(mi,x[k-1+i]-x[i]+min(abs(x[i]),abs(x[k-1+i])))
print(mi)
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,k = inpl()
a = inpl()
now = 0
res = 0
for x in a:
    if x != 1: now += 1
    if now == k-1:
        res += 1
        now = 0
if now: res += 1
print(res)
# Judge status: Accepted
N = int(input())
if N%2 == 0:
    print(1/2)
else:
    print(-(-N//2)/N)
# Judge status: Wrong Answer
s=input()
if s == 'ARC':
  print('ABC')
else:
  print('ABC')
# Judge status: Wrong Answer
# C Vacation
N = int(input())
A = [list(map(int, input().split())) for i in range(N)]

#print(N,A)

dp = [[0] * 3 for _ in range(N)]
dp[0][0] = A[0][0]
dp[0][1] = A[0][1]
dp[0][2] = A[0][2]
#print(dp)

for i in range(N):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j],dp[i-1][k]+A[i][j])

print(max(dp[N-1]))
# Judge status: Wrong Answer
n = int(input())
print((n-1)//2 * (1 + (n-1)))
# Judge status: Accepted
r,g,b=map(int,input().split())
print("YES"if (100*r+10*g+b)%4==0 else "NO")
# Judge status: Accepted
import sys
import numpy as np
mod=10**9+7
n=int(sys.stdin.buffer.readline())
a=np.fromstring(sys.stdin.buffer.readline(),dtype=np.int64,sep=' ')
ans=0
b=1
for i in range(60):
    s=int((a&1).sum())
    ans=(ans+s*(n-s)*b)%mod
    a>>=1
    b=b*2%mod
print(ans)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l.sort()
import bisect

ans = 0
for i in l:
  a = bisect.bisect_right(l,i+1)-bisect.bisect_left(l,i-1)
  ans = max(ans,a)
print(ans)
# Judge status: Accepted
l,r,d = map(int,input().split())
c = 0
for i in range(l , r+1):
    if i % d == 0:
        c = c+1

print(c)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a==b:
  print(a+b)
elif a<b:
  print(b*2)
else:
  print(a*2)
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
if s[a] == '-' and s.count('-') == 1:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))

M = 0
temp = K
while temp>0:
    M += 1
    temp>>=1

nexts = [[-1]*N for _ in range(M)]
for i in range(N):
    nexts[0][i] = A[i]-1

for t in range(1,M):
    for i in range(N):
        nexts[t][i] = nexts[t-1][nexts[t-1][i]]

Kb = [0]*M
temp = K
for i in range(M):
    Kb[i] = temp&1
    temp >>= 1

ans = 0
for i in reversed(range(M)):
    if Kb[i]:
        ans = nexts[i][ans]
print(ans+1)