Harryxun/stf_run huggingface dataset:
n, time = map(int, input().split())
 
arr = list(map(int, input().split())) + [float("inf")]
 
left, temp, sum_time = 0, 0, 0
 
for t in arr[1:]:
  if t <= temp + time:
    temp = t
  else:
    sum_time += (temp + time - left)
    left, temp = t
 
print(sum_time)

### FIXED CODE ###

n, time = map(int, input().split())
 
arr = list(map(int, input().split())) + [float("inf")]
 
left, temp, sum_time = 0, 0, 0
 
for t in arr[1:]:
  if t <= temp + time:
    temp = t
  else:
    sum_time += (temp + time - left)
    left, temp = t, t
 
print(sum_time)
wake_up_hour= int(input())
wake_up_minute=int(input())
sleep_hour=int(input())
sleep_minute= int(input())
study_time=int(input())

#print(wake_up_hour, wake_up_minute, sleep_hour, sleep_minute, study_time)
Total_Minutes = (sleep_hour) *60 + (sleep_minute) - ((wake_up_hour) * 60 + (wake_up_minute))
if Total_Minutes > study_time:
    print("You can finish the study")
    start_before_minute= ((sleep_hour*60 +  sleep_minute) - study_time) % 60
    start_before_hour= ((sleep_hour*60 +  sleep_minute) - study_time) // 60 
    print("Start before: ", start_before_hour, start_before_minute, )
else:
    print("You are lazy!!!. wake up early")

### FIXED CODE ###

import math
import re
import copy

h1,m1,h2,m2,k = map(int,input().split())
w1 = h1*60 + m1
w2 = h2 * 60 + m2
w3 = (w2-w1+24*60)%(24*60)
w3 = w3 - k
print(w3)
a,b,c,d = map(int,input().split())

aoki_new = (a+d-1)/d
taka_new1 = (a+b-1)/b

if taka_new1 < aoki_new :
	print("No") #takahasi is loses because its heath is zero first
else:
	print("Yes")






### FIXED CODE ###

s,w = map(int,input().split())

if s<w or s==w:
	print("unsafe")
else:
	print("safe")
n,m,q = map(int,input().split())
abcd = [list(map(int,input().split())) for _ in range(q)]
ans = 0
for a in range(1,11):
  for b in range(a,11):
    for c in range(b,11):
      for d in range(c,11):
        for e in range(d,11):
          for f in range(e,11):
            for g in range(f,11):
              for h in range(g,11):
                for i in range(h,11):
                  for j in range(i,11):
                    lst = [0,a,b,c,d,e,f,g,h,i,j]
                    print(lst)
                    s = 0
                    for l in range(q):
                      s += abcd[l][3]*(lst[abcd[l][1]]-lst[abcd[l][0]]==abcd[l][2])
                    ans = max(ans, s)
print(ans)

### FIXED CODE ###

k = int(input())
a,b = map(int,input().split())
if b//k-(a-1)//k >0:
  print("OK")
else:
  print("NG")
a,b=[int(i) for i in input().split()]
x=(a+b)/2
if  (a+b)%2==0:
  prnit(x)
else:
  print(x%1+1)

### FIXED CODE ###

a,b=[int(i) for i in input().split()]
x=a+b+1
print(x//2)
f = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
n, m = map(int, input().split())
a = list(map(int, input().split()))

memo = [-1]*10010


def dp(i):
    # i本のマッチを使って作れる最大の整数
    if memo[i] != -1:
        return memo[i]
    if i < 0:
        return -10**100000
    if i == 0:
        return 0
    ret = -10*100000
    for x in a:
        ret = max(ret, 10 * dp(i - f[x]) + x)
    memo[i] = ret
    return ret


print(dp(n))


### FIXED CODE ###

import resource
import sys
sys.setrecursionlimit(20000)
f = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
n, m = map(int, input().split())
a = list(map(int, input().split()))

memo = ["-1"] * 10100


def MAX(x, y):
    if y[0] != '#' and (x == "#" or len(x) < len(y) or (len(x) == len(y) and x < y)):
        return y
    else:
        return x


def dp(i):
    # i本のマッチを使って作れる最大の整数
    if i < 0:
        return "#"

    if memo[i] != "-1":
        return memo[i]

    if i == 0:
        return ""

    ret = "#"
    for x in a:
        ret = MAX(ret, dp(i - f[x]) + str(x))
    memo[i] = ret
    return ret


print(dp(n))
n = raw_input()

x = n * 800
y = (n % 15) * 200

print x-y

### FIXED CODE ###

n = int(raw_input())

x = n * 800
y = (n / 15) * 200

print x-y
S = input()

if S == 'zyxwvutsrqponmlkjihgfedcba':
    print(-1)
    exit()

tmp = {a: 0 for a in 'abcdefghijklmnopqrstuvwxyz'}

for x in S:
    tmp[x] += 1

tmp2 = []
if all(x == 1 for x in tmp.values()):
    for i in range(len(S)-1, 0, -1):
        if S[i-1] < S[i]:
            print(S[:i-1] + min(tmp2))
            exit()
        tmp2.append(S[i])
else:
    for k, v in tmp.items():
        if v == 0:
            print(S+k)
            break

### FIXED CODE ###

S = input()

if S == 'zyxwvutsrqponmlkjihgfedcba':
    print(-1)
    exit()

tmp = {a: 0 for a in 'abcdefghijklmnopqrstuvwxyz'}

for x in S:
    tmp[x] += 1

tmp2 = []
if all(x == 1 for x in tmp.values()):
    for i in range(len(S)-1, 0, -1):
        tmp2.append(S[i])
        if S[i-1] < S[i]:
            tmp2 = [x for x in tmp2 if x > S[i-1]]
            print(S[:i-1]+min(tmp2))
            exit()
else:
    for k, v in tmp.items():
        if v == 0:
            tmp2.append(k)
    print(S+min(tmp2))
a,b,c = map(int,input().split())

cost = 0
ans = 0
while True:
  if(b <= cost):
    break
  cost += a
  ans += 1
print(min(ans-1,c)
  

### FIXED CODE ###

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

if a*c <= b:
  print(c)
else:
  print(b//a)
X, N = map(int, input().split())
P = list(map(int, input().split()))

A = [0]*101
for i in P:
    A[i] = 1

if A[X] == 0:
    print(X)
    exit()

count = 1
while(1):
    if (X - count) <= 101 and (X - count) >= 0:
        if A[X - count] == 0:
            print(X - count)
            exit()

    if count > 0:
        count = -count
    else:
        count = -count
        count += 1

### FIXED CODE ###

X, N = map(int, input().split())
P = list(map(int, input().split()))

A = [0]*101

for i in P:
    A[i] = 1

if A[X] == 0:
    print(X)
    exit()

count = 1
while(1):
    if (X - count) >= 0:
        if (X - count) < 101:
            if A[X - count] == 0:
                print(X - count)
                exit()
        else:
            print(101)
            exit()

    if count > 0:
        count = -count
    else:
        count = -count
        count += 1
n = set[int(input()) for i in range(3)]
print((n[0] - n[1] + 1) * (n[0] - n[2] + 1) )

### FIXED CODE ###

n = [int(input()) for i in range(3)]
print((n[0] - n[1] + 1) * (n[0] - n[2] + 1) )
a,b,c,d = map(int, input().split())
i = 1
while a > 0 & c > 0:
    a = a
    c = c - i*b

    if c > 0:
        a = a-i*d
        c = c

        i += 1
if a <= 0:
    print('No')
if c  :
    print('Yes')

### FIXED CODE ###

s,w = map(int,input().split())

if s <= w :
    print('unsafe')

else :
    print('safe')
import bisect
N,K=map(  int,raw_input().split() )
X=map(  int,raw_input().split() )
 
zero_idx=bisect.bisect_left(X,0)
 
t=float("inf")
ans=float("inf")
for i in range(zero_idx):
	if zero_idx-i==K:
		t=X[i]
	else:
		nokori_cnt=K-(zero_idx-i)
		t=2*abs(X[i])+X[zero_idx+nokori_cnt-1]
	ans=min(ans,t)	

for i in range(zero_idx,N):
	if i==zero_idx+K-1:
		t=X[i]
	elif i<zero_idx+K-1:
		nokori_cnt=K-(i-zero_idx)-1
		t=2*X[i]+abs(X[zero_idx-nokori_cnt])
	ans=min(ans,t)

print ans
	


### FIXED CODE ###

N,K=map(  int,raw_input().split() )
X=map(  int,raw_input().split() )

ans=float("inf")
t=float("inf")
for l in range(N-K+1):
	r=l+K-1
	if X[l]<0:
		if X[r]<0:	
			ans=min(ans, abs(X[l]) )
		else:	
			ans=min(ans, 2*abs(X[l])+abs(X[r]) , abs(X[l])+2*abs(X[r]) )
	elif X[l]>=0 and X[r]>=0:
		ans=min(ans, X[r] )


print ans
nm=input().split()
vote=[int(i) in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
for v in vote:
	if v < 4*m:
		continue
	else:
		selectable+=1
if selectable>=m:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

nm=input().split()
vote=[int(i) for i in input().split()]
n=int(nm[0])
m=int(nm[1])
selectable=0
all=sum(vote)
for v in vote:
	if v < all/(4*m):
		continue
	else:
		selectable+=1
if selectable>=m:
	print("Yes")
else:
	print("No")
import sys
from math import gcd

N = int(input())

A = list(map(int, input().split()))
A.sort()


if len(A) < 3:
    print(max(A))
    sys.exit()


left_side = [0 for _ in range(N)]
left_side[0] = A[0]

right_side = [0 for _ in range(N)]
right_side[-1] = A[-1]



for i in range(N -1):
    left_side[i + 1] = gcd(left_side[i], A[i + 1])

for i in range(1, N):
    right_side[-1* (i + 1)] = gcd(right_side[-1* i], A[ -1 *(i + 1)])


max_gcd = 1 
for i in range(1, N -1 ):
    left = left_side[i - 1]
    right = right_side[i + 1]
    max_gcd = max(max_gcd, gcd(left, right))




print(max_gcd)






### FIXED CODE ###

import sys
from fractions import gcd

N = int(input())

A = list(map(int, input().split()))
A.sort()


if len(A) < 3:
    print(max(A))
    sys.exit()


left_side = [0 for _ in range(N)]
left_side[0] = A[0]

right_side = [0 for _ in range(N)]
right_side[-1] = A[-1]



for i in range(N -1):
    left_side[i + 1] = gcd(left_side[i], A[i + 1])

for i in range(1, N):
    right_side[-1* (i + 1)] = gcd(right_side[-1* i], A[ -1 *(i + 1)])


max_gcd = 1 

# left 
max_gcd = max(max_gcd, right_side[1])
# right
max_gcd = max(max_gcd, left_side[-2])

for i in range(1, N -1 ):
    left = left_side[i - 1]
    right = right_side[i + 1]
    max_gcd = max(max_gcd, gcd(left, right))




print(max_gcd)
A_V = input().split(" ")
B_W = input().split(" ")
T = int(input())
A = int(A_V[0])
V = int(A_V[1])
B = int(B_W[0])
W = int(B_W[1])
dA = A + V * T
dB = B + W * T
ndA = A - V * T
ndB = B - W * T
if (dA < dB):
    if (ndA > ndB)
        print("NO")
    else:
        print("YES")

### FIXED CODE ###

A_V = input().split(" ")
B_W = input().split(" ")
T = int(input())
A = int(A_V[0])
V = int(A_V[1])
B = int(B_W[0])
W = int(B_W[1])
dA = A + V * T
dB = B + W * T
ndA = A - V * T
ndB = B - W * T
if (A<B):
    if (dA < dB):
        print("NO")
    else:
        print("YES")
else:
    if (ndA > ndB):
        print("NO")
    else:
        print("YES")
n = int(input())
s = []
for i in range(n):
    s.append(input()[0])

def qwe(y):
    m = 0
    a = 0
    r = 0
    c = 0
    h = 0
    for i in y:
        if i == 'M':
            m += 1
        elif i == 'A':
            a += 1
        elif i == 'R':
            r += 1
        elif i == 'C':
            c += 1
        elif i == 'H':
            h += 1
        else:
            pass
    q = [m,a,r,c,h]
    return q

def qwer(arr):
    count = 0
    for j in range(len(arr)):
        if arr[j] == 0:
            count += 1
            arr.pop(j)
    if count == 5:
        return 0
    if count == 4:
        return 0
    if count == 3:
        return 0
    if count == 2:
        wer = arr[0] * arr[1] * arr[2]
        return wer
    if count == 1:
        asd_1 = arr[0]*arr[1]*arr[2]
        asd_2 = arr[0]*arr[1]*arr[3]
        asd_3 = arr[0]*arr[2]*arr[3]
        asd_4 = arr[1]*arr[2]*arr[3]
        asde = asd_1 + asd_2 + asd_3 + asd_4
        return asde
    if count == 0:
        asf_1 = arr[0]*arr[1]*arr[2]
        asf_2 = arr[0]*arr[1]*arr[3]
        asf_3 = arr[0]*arr[1]*arr[4]
        asf_4 = arr[0]*arr[2]*arr[3]
        asf_5 = arr[0]*arr[2]*arr[4]
        asf_6 = arr[0]*arr[3]*arr[4]
        asf_7 = arr[1]*arr[2]*arr[3]
        asf_8 = arr[1]*arr[2]*arr[4]
        asf_9 = arr[1]*arr[3]*arr[4]
        asf_10 = arr[2]*arr[3]*arr[4]
        asdf =  asf_1 + asf_2 + asf_3 + asf_4 + asf_5 + asf_6 + asf_7 + asf_8 + asf_9 + asf_10
        return asdf
v = qwe(s)
print(qwer(v))


### FIXED CODE ###

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

def qwe(y):
    m = 0
    a = 0
    r = 0
    c = 0
    h = 0
    for i in y:
        if i == 'M':
            m += 1
        elif i == 'A':
            a += 1
        elif i == 'R':
            r += 1
        elif i == 'C':
            c += 1
        elif i == 'H':
            h += 1
        else:
            pass
    q = [m,a,r,c,h]
    return q

def qwer(arr):
    count = 0
    for j in range(len(arr)):
        if arr[j] == 0:
            count += 1
            arr[j] = "D"
    while "D" in arr:
        arr.remove("D")
    if count == 5:
        return 0
    if count == 4:
        return 0
    if count == 3:
        return 0
    if count == 2:
        wer = arr[0] * arr[1] * arr[2]
        return wer
    if count == 1:
        asd_1 = arr[0]*arr[1]*arr[2]
        asd_2 = arr[0]*arr[1]*arr[3]
        asd_3 = arr[0]*arr[2]*arr[3]
        asd_4 = arr[1]*arr[2]*arr[3]
        asde = asd_1 + asd_2 + asd_3 + asd_4
        return asde
    if count == 0:
        asf_1 = arr[0]*arr[1]*arr[2]
        asf_2 = arr[0]*arr[1]*arr[3]
        asf_3 = arr[0]*arr[1]*arr[4]
        asf_4 = arr[0]*arr[2]*arr[3]
        asf_5 = arr[0]*arr[2]*arr[4]
        asf_6 = arr[0]*arr[3]*arr[4]
        asf_7 = arr[1]*arr[2]*arr[3]
        asf_8 = arr[1]*arr[2]*arr[4]
        asf_9 = arr[1]*arr[3]*arr[4]
        asf_10 = arr[2]*arr[3]*arr[4]
        asdf =  asf_1 + asf_2 + asf_3 + asf_4 + asf_5 + asf_6 + asf_7 + asf_8 + asf_9 + asf_10
        return asdf
v = qwe(s)
print(qwer(v))
kuku = [i * j for i　in range(1,10) for j in range(1,10)]
N = int(input())

print('Yes' if N in kuku else 'No')

### FIXED CODE ###

kuku = [i * j for i in range(1,10) for j in range(1,10)]
N = int(input())
 
print('Yes' if N in kuku else 'No')
inp = [[int(x) for x in input().split()] for _ in range(int(input()))]
inpsum = sum(map(lambda ij: abs(ij[0]+ij[1]) % 2, inp))
if not (inpsum == len(inp) or inpsum == 0):
    print(-1)
    exit(0)

# print(inp)

max_abs = max(*map(lambda ij: abs(ij[0])+abs(ij[1]), inp))
print(max_abs)
print(' '.join(['1']*max_abs))

for i, j in inp:
    tmp = max_abs
    res = ''
    res += ('L' if i < 0 else 'R')*abs(i)
    res += ('D' if j < 0 else 'U')*abs(j)
    res += 'LR' * ((max_abs - len(res)) // 2)
    print(res)


### FIXED CODE ###

inp = [[int(x) for x in input().split()] for _ in range(int(input()))]
inpsum = sum(map(lambda ij: abs(ij[0]+ij[1]) % 2, inp))
if not (inpsum == len(inp) or inpsum == 0):
    print(-1)
    exit(0)

seeds = ([] if inpsum == len(inp) else [1]) + [1 << i for i in range(0, 32)]
# print(inp)

print(len(seeds))
print(' '.join(map(str, reversed(seeds))))

for x, y in inp:
    for k in reversed(seeds):
        res = ''
        if abs(x) > abs(y):
            if x > 0:
                res = 'R'
                x -= k
            else:
                res = 'L'
                x += k
        else:
            if y > 0:
                res = 'U'
                y -= k
            else:
                res = 'D'
                y += k
        # print((x,y))
        print(res, end='')
    print('')
def main(N):
    A = list(map(int, input().split()))
    st_A = set(A)
    if 0 in st_A:
        print(0)
        x = 1
    else:
        for a in A:
            x *= a
            if x > 10 ** 18:
                print(-1)
                exit()
        else:
            print(x)





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

### FIXED CODE ###

def main(N):
    A = list(map(int, input().split()))
    st_A = set(A)
    if 0 in st_A:
        print(0)
    else:
        x = 1
        for a in A:
            x *= a
            if x > 10 ** 18:
                print(-1)
                exit()
        else:
            print(x)





if __name__ == '__main__':
    N = int(input())
    main(N)
x,t = int(input()),int(input())
y = x - t
print('{0}'.format(y))

### FIXED CODE ###

l = input().split()
x = int(l[0])
t = int(l[1])
y = x - t
if y > 0:
	print('{0}'.format(y))
else:
	print('0')
import math
N=int(input())
P=0
P+=N
Eratosthenes = [p for p in range(2, math.ceil(N ** 0.5))]
number = Eratosthenes[0]
sosuu = []
while number < N ** 0.25:
    sosuu.append(number)
    n_Eratosthenes = []
    for n in Eratosthenes:
        if n % number == 0:
            pass
        else:
            n_Eratosthenes.append(n)
    if len(n_Eratosthenes) == 0:
        break
    number = n_Eratosthenes[0]
    Eratosthenes = n_Eratosthenes
numbers = sosuu + Eratosthenes
suuji = 0
answers = []
while N > 1 and suuji < len(numbers):
    number = numbers[suuji]
    if N % number == 0:
        answers.append(number)
        N = N // number
    else:
        suuji += 1
number=1
for n in answers:
    number*=n
other=P//number
if other==1:
    a=1
    b=1
    for n in range(len(answers)):
        if n%2==0:
            a*=answers[n]
        else:
            b*=answers[n]
    print(max(len(str(a)),len(str(b))))
else:
    print(max(len(str(other)),len(str(number))))
    


### FIXED CODE ###

N=int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
yakusuu=make_divisors(N)
if len(yakusuu)%2 != 0:
    print(len(str(yakusuu[len(yakusuu)//2])))
else:
    ans=pow(10,9)
    for n in range(len(yakusuu)//2):
        number=max(len(str(yakusuu[n])),len(str(yakusuu[-n-1])))
        ans=min(ans,number)
    print(ans)
import math
from functools import reduce

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

def lcm_list(nums):
  return reduce(lcm, nums)

n = int(input())
a = list(map(int, input().split()))
m = lcm_list(a) - 1
ans = 0
for i in range(n):
  ans += m % a[i]

print(ans)

### FIXED CODE ###

from functools import reduce


def gcd(a,b):
  x = max([a,b])
  y = min([a,b])
  while y:
    x, y = y, x % y
  return x

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

def lcm_list(nums):
  return reduce(lcm, nums)
n = int(input())

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




m = lcm_list(a) - 1


ans = 0
for i in range(n):
  ans += m % a[i]
  
  
print(ans)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, M = LI()
    A = LI()
    num2match = {
        1: 2,
        2: 5,
        3: 5,
        4: 4,
        5: 5,
        6: 6,
        7: 3,
        8: 7,
        9: 6,
    }
    dp = ['' for _ in range(N+1)]
    for a in A:
        match_need = num2match[a]
        dp[match_need] = max(str(dp[match_need]), str(a))
    for i in range(N+1):
        for a in A:
            match_need = num2match[a]
            if i - match_need > 0:
                if dp[i-match_need] == '':
                    continue
                old = dp[i]
                new = str(a) + dp[i-match_need]
                if len(old) > len(new):
                    dp[i] = old
                elif len(new) > len(old):
                    dp[i] = new
                else:
                    dp[i] = max(old, new)
    print(dp[N])
main()



### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, M = LI()
    A = LI()
    num2match = {
        1: 2,
        2: 5,
        3: 5,
        4: 4,
        5: 5,
        6: 6,
        7: 3,
        8: 7,
        9: 6,
    }
    dp = ['' for _ in range(N+1)]
    for a in A:
        match_need = num2match[a]
        if 0 <= match_need <= N:
            dp[match_need] = max(str(dp[match_need]), str(a))
    for i in range(N+1):
        for a in A:
            match_need = num2match[a]
            if i - match_need > 0:
                if dp[i-match_need] == '':
                    continue
                old = dp[i]
                new = str(a) + dp[i-match_need]
                if len(old) > len(new):
                    dp[i] = old
                elif len(new) > len(old):
                    dp[i] = new
                else:
                    dp[i] = max(old, new)
    print(dp[N])
main()
a = list(map(int, input().split()))
print("YES" if b - a == c - b else "NO")

### FIXED CODE ###

a = list(map(int, input().split()))
print("YES" if a[1] - a[0] == a[2] - a[1] else "NO")
s = input()
if s in 7:
  print(Yes)
  else:
    print(No)


### FIXED CODE ###

s = str(input())
if s[0] is "7":
  print("Yes")
elif s[1] is "7":
  print("Yes")
elif s[2] is "7":
  print("Yes")
else:
  print("No")
A,B,N=map(int,input().split())
import math
def f(x):
    return math.floor(A*x/B) - A*math.floor(x/B)

ans = []
for i in list(reversed(range(1, N//B+1)))[:100]:
    ans.append(f(B*i-1))
ans.append(f(N))
ans.append(f(1))
#print(f(N))
print(max(ans))

### FIXED CODE ###


A,B,N=map(int,input().split())
import math
def f(x):
    return math.floor(A*x/B) - A*math.floor(x/B)


print(f(min(B-1,N)))
# C - Bridge
# https://atcoder.jp/contests/abc075/tasks/abc075_c

from collections import deque

def dfs(i):
  visited = [False] * n
  stack = deque()
  stack.append(i)
  visited[i] = True
  while stack:
    q = stack.popleft()
    nxts = graph[q]
    for nxt in nxts:
      if not visited[nxt]:
        visited[nxt] = True
        stack.append(nxt)
  return visited

n, m = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(m)]

ans = 0
for i in range(m):
  graph = [[] for _ in range(n)]
  for itr, (a, b) in enumerate(edge):
    if itr != i:
      graph[a - 1].append(b - 1)
      graph[b - 1].append(a - 1)

  if not all(dfs(i)):
    ans += 1

print(ans)


### FIXED CODE ###

from scipy.sparse.csgraph import dijkstra
N, M = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(M)]

graph = [[0] * (N + 1) for _ in range(N + 1)]
for a, b in edge:
  graph[a][b] = 1

answer = 0
INF = 10 ** 9
for a, b in edge:
  # a-bのedgeを取り除いた場合にa-bの距離を測る
  graph[a][b] = INF
  dist = dijkstra(graph, indices = a, directed = False)
  if dist[b] >= INF:
    answer += 1
  # a-bのedgeを戻す
  graph[a][b] = 1

print(answer)
n = int(input())
w = list(map(int, input().split()))
wa = 0
for i in range(len(w)):
    wa += w[i]
wa2 = 0
wa3 = 0
i = 0
while wa2 <= wa / 2:
    wa2 += w[i]
    i += 1
for j in range(i, len(w)+1):
    wa3 += w[j]
print(abs(wa2 - wa3))
exit()


### FIXED CODE ###

n = int(input())
w = [int(i) for i in input().split()]
p = 100000
a = sum(w)
k = 0
for i in range(n - 1):
    k += w[i]
    p = min(p, abs(k - (a - k)))
print(p)