peterverebics/CodeNet_Python_118 huggingface dataset:
N, K = map(int, input().split())
alist = list(map(int, input().split()))

ans = 1
N -= K

while N > 0:
    N -= K-1
    ans += 1

print(ans)
n,k = map(int,input().split())
a_L = list(map(int,input().split()))

ans = 1
n = n-k

while True:
    if n<=0:
        print(ans)
        exit()
    n = n-k+1
    ans += 1
n, k = (int(x) for x in input().split())

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

if n == k:
    print(1)
elif k == 2:
    print(n-1)
else:
    rem = n % (k-1)
    m = (n - rem) / (k-1)
    if rem <= 1:
        print(int(m))
    else:
        print(int(m+1))
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
print(ceil((n-1)/(k-1)))
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = -(-(n-1)//(k-1))
print(ans)
n, k = map(int, input().split())
a = list(map(int, input().split()))


def ceil(x, y):
    if x % y == 0:
        return x // y
    else:
        return x // y + 1


print(ceil(n-1, k-1))
N, K = map(int, input().split())
A = list(int(a) for a in input().split())

print(((N-1)+(K-2))//(K-1))
N,K=map(int,input().split())
A=list(map(int,input().split()))
N=N-1
K=K-1
if N==K:
    print(1)
    exit()
if N%K==0:
    print(N//K)
else:
    print(N//K+1)
n, k = map(int, input().split())
a = list(map(int, input().split()))

if k < n:
    c = 1
    n -= k
    while n > 0:
        n -= k-1
        c += 1
    print(c)
else:
    print(1)
def main():
    n, k = map(int, input().split())
    As = list(map(int, input().split()))

    ans = (n-2) // (k-1) + 1
    print(ans)


if __name__ == "__main__":
    main()
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

b = a.index(1) 
ans = 0
b -= (k-1)
if b < 0:
    b = a.index(1) + abs(b)
if b > n-1 -(k-1):
    b -= b- (k-1)
c,d = divmod(b,k-1)
ans += c
if d != 0:
    ans +=1
e,f = divmod(n-1 - b,k-1)
ans += e
if f != 0:
    ans +=1
if d != 0 and f != 0 and d + f <= k-1:
    ans -=1
print(ans)
n,k=map(int,input().split())
a=list(map(int,input().split()))
print(-(-(n-1)//(k-1)))
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, K, *A = map(int, read().split())

    print((N - 2) // (K - 1) + 1)

    return


if __name__ == '__main__':
    main()
import math

N, K = map(int, input().split())
A = list(input().split())
A_lis = [int(A[i]) for i in range(N)]
index = A_lis.index(1)

if N == K:
    print(1)
else:
    left = math.ceil(index / (K-1))
    leftamari = index % (K-1)
    right = math.ceil(max(0, N - 1 - index - (K - 1 - leftamari if leftamari != 0 else 0)) / (K-1))
    print(left + right)
n,k = map(int,input().split())
input()
print(1 if n==k else 1+(n-2)//(k-1))
import math


def main():
    n, k = map(int, input().split())
    As = list(map(int, input().split()))
    ans = math.ceil((n-1)/(k-1))
    print(ans)


if __name__ == "__main__":
    main()
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
print((n-1+k-2)//(k-1))
from math import ceil

N, K = map(int, input().split())
A = list(map(int, input().split()))

if N == K:
    print(1)
    exit()


print(ceil((N - K) / (K - 1)) + 1)
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
x=n-1
y=k-1
print((x+y-1)//y)
N,K=map(int,input().split())
*A,=map(int,input().split())

print((N-2)//(K-1)+1)
N, K = map(int, input().split())
A = list(map(int, input().split()))

# 1の場所を探す
pos = A.index(1)

count = 0
num_forward = pos  # 前方の残り数
num_backward = N - pos - 1  # 後方の残り数

# 前方にX回試行したときに負の余りが生じる場合は後方に回す
rest = num_forward % -(K - 1)
num_backward += rest

while num_forward > 0:  # 先頭まで1にする
    num_forward -= K - 1
    count += 1
while num_backward > 0:  # 末尾まで1にする
    num_backward -= K - 1
    count += 1
print(count)
import math

def solve(n, k, A):
    return math.ceil((len(A) - A.count(min(A))) / (k - 1))

_n, _k = map(int, input().split())
_A = list(map(int, input().split()))
print(solve(_n, _k, _A))
n, k = map(int, input().split())
A = list(map(int, input().split()))
answer = 100000
while True:
    if n <= k + (k - 1) * (answer - 1):
        answer -= 1
    else:
        break

print(answer + 1)
import math

N,K = map(int,input().split())
A = list(map(int,input().split()))

N -= K
K -= 1
C = math.ceil(N/K)

print(C+1)
n, k = map(int, input().split())
an = list(map(int, input().split()))
mini = min(an)
need = 0
for a in an:
    if a != mini:
        need += 1
print(-(-need//(k-1)))
N,K = map(int, input().split())
A = list(map(int, input().split()))
print((N+K-3)//(K-1))
n,k = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

k -= 1
cnt = -(-(n-1)//k)

print(cnt)
import math
n,k = map(int,input().split())
A = list(map(int,input().split()))
print(math.ceil((n-1)/(k-1)))
n,k=map(int,input().split())
A = list(map(int,input().split()))
n -= k
k -= 1
ans = 1
ans += (n+k-1)//k
print(ans)
n,k=map(int,input().split())
print(0--~-n//~-k)
import math
n, k = map(int, input().split())
A = input()

print(math.ceil((n-1) / (k-1)))
n,k = map(int,input().split())
a_ = list(map(int,input().split()))
if (n-1)%(k-1) == 0:
    print((n-1)//(k-1))
else:
    print((n-1)//(k-1)+1)
import math
N, K = list(map(int,input().split()))
print(math.ceil((N - 1) / (K - 1)))
n,k = map(int, input().split())

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

if n==k:
    print(1)
    exit()
    
x = 1+(n-k)//(k-1)
y = (n-k)%(k-1)

if y >0:
    print(x+1)
else:
    print(x)
N,K=map(int,input().split())
A=list(map(int,input().split()))
if N<=K:
  print(1)
else:
  i=K
  a=1
  while i<N:
    i+=(K-1)
    a+=1
  print(a)
n,k = map(int,input().split())
a = list(map(int,input().split()))
s = k
i = 1
while n > s:
    s += (k-1)
    i += 1

print(i)
N,K = map(int,input().split())
A = list(map(int,input().split()))
#最終的にすべての値は1になる
if N==K:
    print(1)
    exit()
ans = 1
t = K
while(1):
    if t >= N:
        print(ans)
        exit()
    t += (K-1)
    ans += 1
n,k = map(int,input().split())

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

print(-(-(n-1)//(k-1)))
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
print(math.ceil((n-1) / (k-1)))
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    print((N + K - 3) // ~-K)


if __name__ == "__main__":
    main()
N, K = map(int, input().split())
A = list(map(int, input().split()))

idx = A.index(1)

ans = N
for k in range(K + 1):
    L = idx - (K - k - 1)
    R = (N - 1 - idx) - k
    cntL = 0
    cntR = 0
    while L > 0:
        cntL += 1
        L -= K - 1
    while R > 0:
        cntR += 1
        R -= K - 1
    ans = min(ans, cntL + cntR + 1)

print(ans)
n, k = map(int, input().split())
a = list(map(int, input().split()))
print(-(-(n - 1) // (k - 1)))
n,k=list(map(int,input().split()))
print(-(-(n-k)//(k-1))+1)
n, k = map(int, input().split())
aaa = list(map(int, input().split()))
cnt = 1
b = n - k
while b > 0:
    b -= k - 1
    cnt += 1
print(cnt)
N, K = map(int, input().split())
A = list(map(int, input().split()))

if (N-1)%(K-1) == 0:
    print(int((N-1)/(K-1)))
else:
    print(int((N-1)/(K-1)) + 1)
def main():
    n, k = map(int, input().split())
    a_lst = list(map(int, input().split()))

    tmp = k
    count = 1
    while tmp < n:
        tmp += k - 1
        count += 1

    print(count)


if __name__ == '__main__':
    main()
n,k = map(int,input().split())
a = list(map(int,input().split()))
import math
print(math.ceil((n-1)/(k-1)))
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
print(math.ceil((n-1) / (k-1)))
# 1以外のn-1個のうち、1回で最大k-1個まで1にできる
import math
n,k = list(map(int, input().split()))
As = list(map(int,input().split()))
print(math.ceil((n-1)/(k-1)))
k,n=map(int,input().split())
a=input()
i=0
while True:
    if k<=n+(n-1)*i:print(i+1);break
    i+=1
n,k=map(int,input().split())
a=[int(x) for x in input().split()]
ans=(n-1)//(k-1)
if (n-1)%(k-1)!=0:
  ans+=1
print(ans)
#!python3

# input
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))


def main():
    s = N - K
    k = K - 1
    ans = 1
    ans += s // k
    if s % k != 0:
        ans += 1
    print(ans)


if __name__ == "__main__":
    main()
n, k = map(int, input().split())
s = input()
i = s.find("1")/2
ans = 0

# former part
while ans * (k-1) < i:
    ans += 1
i = max(i, ans * (k-1))

# latter part
tmp = 0
while tmp * (k-1) + i < n-1:
    tmp += 1

print(ans + tmp)
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7
MAX = 10**18
MIN = -10**18

n,k = map(int,input().split())
a = list(map(int,input().split()))
print(math.ceil((n-1)/(k-1)))
n,k=map(int,input().split())
a=list(map(int,input().split()))
count=1
n=n-k
while(n>0):
    n=n-(k-1)
    count+=1
print(count)
n,k = map(int,input().split())
A = list(map(int,input().split()))

from math import ceil

def main():
    print(ceil((n-1)/(k-1)))
        
if __name__ == "__main__":
    main()
n,k = map(int,input().split())
lst = list(map(int,input().split()))

id_of_one = lst.index(1) #リスト内の最小値1のインデックスを取得

left = len(lst[0:id_of_one]) #1より左側にある数列の長さ
right = len(lst[id_of_one+1:]) #1より右側にある数列の長さ
total = left + right





counter = 0
while total > 0:
    counter += 1
    total -= k - 1

print(counter)
# import bisect
# from collections import Counter, deque
# import copy
# from fractions import gcd
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline

def resolve():
    N,K=map(int,input().split())
    A=list(map(int,input().split()))

    if N==K:
        print(1)
    else:
        N=N-K
        print(1+-(-N//(K-1)))


resolve()
def main():
    import sys
    input = sys.stdin.readline
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    ans = 0
    for x in range(1, N+1):
        if (K-1)*x + 1 >= N:
            ans = x
            break
    print(ans)
main()
N, K = map(int, input().split())
A = list(map(int, input().split()))

cnt = 1
length = K
while True:
    if length >= N:
        print(cnt)
        break
    length += K-1 
    cnt += 1
from math import ceil


def main():
    length, section_range = map(int, input().split(" "))
    numbers = list(map(int, input().split(" ")))
    print(ceil((length - 1) / (section_range - 1)))


if __name__ == '__main__':
    main()
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
x=a.index(1)
print(math.ceil((n-1)/(k-1)))
import math
s = list(map(int, input().split()))
n=s[0]
k=s[1]-1
s = list(map(int, input().split()))
ind=s.index(1)
# print(ind,n-ind-1,math.ceil(ind/k),math.ceil((n-ind-1)/k))
print(math.ceil((n-1)/(k)))
n,k = map(int,input().split())
A = input()

ans = 1 + -(-(n-k)//(k-1))

print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))
if((N-1)%(K-1) == 0):
  print((N-1)//(K-1))
else:
  print((N-1)//(K-1) + 1)
N, K = map(int, input().split())
A = list(map(int, input().split()))

def solve(N,K,A):
    ans = -(-(N-1)//(K-1))
    return ans
print(solve(N,K,A))
# https://atcoder.jp/contests/abc101/tasks/arc099_a


import sys
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


N, K = read_ints()
if N == K:
    print(1)
    exit()
A = read_ints()

K -= 1
i = A.index(1)

# 怒りの全探索
ans = 0
for j in range(0, N - 1, K):
    ans += 1

print(ans)
n,k = map(int, input().split())
a = list(map(int, input().split()))
if (n==k):
    print(1)
else:
    print(1+(n-k-1)//(k-1)+1)
n,k=map(int,input().split())
a=list(map(int,input().split()))
g=1
while k+(k-1)*(g-1)< n:
  g+=1
print(g)
n,k = map(int,input().split())
a = list(map(int,input().split()))
count =0
while True:
    count += 1
    n -= (k)
    if n <= 0:
        break
    n += 1
print(count)
n, k = map(int, input().split())
print((n + k - 3) // (k - 1))
import math
N, K = map(int, input().split())
*A, = map(int, input().split())
print(math.ceil((N - 1) / (K - 1)))
N,K = map(int,input().split())
A = list(map(int,input().split()))
print((N+K-3)//(K-1))
#!/usr/bin/env python3
import sys

def main():
    N, K = map(int,input().split())
    a = list(map(int,input().split()))

    answer = 0
    for i in range(N):
        if K + (i-1)*(K-1) >= N:
            answer = i
            break

    print(answer)
    return

if __name__ == '__main__':
    main()
n,k = map(int,input().split())
a = list(map(int,input().split()))

idx = a.index(1)
ans = 0

ans += -(-idx // (k-1))
ans += -(-(n - ans * (k-1) - 1) // (k-1))

print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = ((N - 1) + (K - 1 - 1)) // (K - 1)
print(ans)
n,k = map(int,input().split())
A = list(map(int,input().split()))
import math
ans = math.ceil(((n-1)/(k-1)))
print(ans)
def resolve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    print(-(-(n-1)//(k-1)))

resolve()
N, K = map(int, input().split())
A = list(map(int, input().split()))

print((N+K-3)//(K-1))
import math
def resolve():
	n, k = map(int, input().split())
	a = list(map(int, input().split()))
	i = a.index(min(a)) + 1
	if k - 1 > i:
		v = max(0, math.ceil((n - k - 2) / (k - 1))) + 1
	else:
		v = math.ceil(i / (k - 1)) + math.ceil((n - i - 1) / (k - 1))
	print(v)
resolve()
from math import ceil

N, K = map(int, input().split())
A = list(map(int, input().split()))

print(ceil((N - 1) / (K - 1)))
a=input().split();print(0--~-int(a[0])//~-int(a[1]))
n,k=map(int,input().split())
k-=1
a=list(map(int, input().split()))
for i in range(n):
    if a[i]==1:
        index=i
print(-(-i//k)-(-(n-i-1)//k))
n, k = map(int, input().split())
a = list(map(int, input().split()))

now = k
res = 1
while now < n:
    now += k-1
    res += 1

print(res)
n,k=map(int,input().split())
a=list(map(int,input().split()))
if n==k:
    print(1)
    exit()
i=n-k
ans=1
while i>0:
    i=i-k+1
    ans+=1
print(ans)
def solve():
    N, K = map(int, input().split())
    Ax = list(map(int, input().split()))
    if N == K:
        print(1)
        exit()

    N -= K
    ans = 1

    while N > 0:
        N = N-(K-1)
        ans += 1

    print(ans)


# Solve
if __name__ == "__main__":
    solve()
n,k=map(int,input().split())
k-=1
a=list(map(int, input().split()))
i=n-1
print(-(-i//k)-(-(n-i-1)//k))#pythonで切り上げの書き方
# coding: utf-8

# https://atcoder.jp/contests/abc101


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ans = 1
    N -= K
    if N % (K-1) == 0:
        ans += N // (K-1)
    else:
        ans += N // (K-1) + 1
    
    return ans


print(main())
N,K=map(int,input().split())
A=list(map(int,input().split()))

ans=1
X=N-K

while X>0:
  X-=K-1
  ans+=1
print(ans)
import math

def main():
    N, K = map(int, input().split())
    input()
    print(math.ceil((N-K)/(K-1) + 1.0))

main()
n,m=map(int,input().split()) 
l=list(map(int,input().split())) 
print(-(-(len(l)-m)//(m-1))+1)
N,K=map(int,input().split())
A=list(map(int,input().split()))
print((N-1-1)//(K-1)+1)
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
tmp = a.index(1)
ans += math.ceil(tmp/(k-1))
tmp = ans * (k-1) +1
ans += math.ceil((n-tmp)/(k-1))
print(ans)
import math
n,k=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]


def get_1_index(a):
    for i,j in enumerate(a):
        if j==1:
            return i


index=get_1_index(a)

mae=index
usiro=n-index-1

# print(math.ceil(mae/(k-1))+math.ceil(usiro/(k-1)))
print(math.ceil((n-1)/(k-1)))
N,K = map(int, input().split())
A = [int(i) for i in input().split()]

if N == K:
    print(1)
else:
    cnt = 1
    N -= K
    while N > 0:
        cnt += 1
        N -= K
        N += 1
    print(cnt)
import math

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


print(math.ceil( (n-k)/(k-1) )+1)
n, k = map(int, input().split())

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


min_a = A.index(min(A))

left = min_a
right = n - min_a - 1


min_ = min(left, right)
max_ = max(left, right)


t = 0
min_ = min_ - k
t +=1
temp = 0
if min_ > 0:
    if min_ % (k - 1) != 0:
        temp = min_ // (k - 1)
    else:
        temp = min_ // (k - 1) + 1
    min_ -= temp * (k - 1)
t += temp

max_ = max_ + min_ + 1

if max_ % (k - 1) == 0:
    t += max_ // (k - 1)
else:
    t += max_ // (k - 1) + 1

print(t)
n,k = map(int,input().split())
_ = input()
print(1 + -(-(n-k)//(k-1)))
n, k = map(int, input().split())
print(1 + (n - 2) // (k - 1))
N,K=map(int,input().split())
A=list(map(int,input().split()))
b=min(A)
p=0
for i in range(N):
  if A[i]!=b:
    p+=1
if p%(K-1)==0:
  print(p//(K-1))
else:
  print(p//(K-1)+1)
N,K = map(int,input().split())
A = list(map(int,input().split()))

ans = (N-1)//(K-1)
if (N-1)%(K-1)!=0:
    ans+=1
print(ans)
N, K = map(int, input().split())
print((N-2)//(K-1)+1)
n,k,*a=map(int,open(0).read().split())
print((n+k-3)//(k-1))
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = 0 - -(n - 1)//(k - 1)

print(ans)
N, K = map(int, input().split())
print(((N - 1) + (K - 2)) // (K - 1))
N,K = (int(X) for X in input().split())
A  = [int(X) for X in input().split()]
Left  = A.index(1)
Right = (N-1)-Left
Count = (Right%(K-1)!=0)+Right//(K-1)
Left  -= (Right%(K-1)!=0)*((K-1)-Right%(K-1))
Count += (Left%(K-1)!=0)+Left//(K-1)
print(Count)
n, k = map(int, input().split())
m = n - 1
l = k - 1

if m % l == 0:
    print(m // l)
else:
    print(m // l + 1)
n, k = map(int, input().split())
As = list(map(int, input().split()))
a=n-1
b=k-1
if a % b == 0:
  print(a//b)
else:
  print((a//b) + 1)
import math

n, k = map(int, input().split())
[int(i) for i in input().split()]
print(math.ceil((n-k) / (k - 1) + 1))
def main():
    n, k = map(int, input().split())
    ans = 1 + (n - k) // (k - 1) + ((n - k) % (k - 1) != 0)
    print(ans)


if __name__ == '__main__':
    main()
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

i = a.index(1)

s = n

for j in range(i-k+1, i+k):
    if j < 0:
        continue
    elif j >= n:
        continue
    else:
        l = j
        u = (n-1-j)
        t = (l+k-2) // (k-1) + (u+k-2) // (k-1)
        #print(t)
        s = min(s, t)

print(s)
import math
import itertools
#n = int(input())
#n, d = list(input().split())
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
point = 0
i = 0
while N > point:
    i+=1
    if i==1:
        point+=K
    else:
        point+=(K-1)

print(i)
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 18 09:56:28 2020

@author: liang
"""
from math import ceil

N, K = map(int, input().split())
A = [int(x) for x in input().split()]
ans = ceil((N-K)/(K-1)) + 1
print(ans)
print(eval('0--~-'+''.join([i if i!=' ' else '//~-' for i in input()])))
import math
N, K = map(int, input().split())
a = list(map(int, input().split()))
M = math.ceil((N-1)/(K-1))
print(M)
N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(100000):
  if N<=K+i*(K-1) :
    print(i+1)
    exit()
n, k = map(int, input().split())
*a, = map(int, input().split())

mar = k - 1  # max replacible count

ret = 1 + (n - k + mar - 1) // mar
print(ret)

# 左端から長さKの区間をのりしろ1で貼り続ける
# 最小値1を含む要素に重なる区間から順に操作を始めれば可能
# i = a.index(1)
# mar = k - 1  # max replacible count
#
# le = (i + mar - 1) // mar  # [0,i)
# ri = (n - i - 1 + mar - 1) // mar  # [i+1,n)
#
# print(le + ri)
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = 1
n -= k
k -= 1

if n % k == 0:
    ans += n // k
else:
    ans += n // k + 1

print(ans)
n,k = map(int,input().split())
a=list(map(int,input().split()))
if (n-1)%(k-1)==0:
    print((n-1)//(k-1))
else:
    print((n-1)//(k-1)+1)
import sys

def resolve():
    N, K = list(map(int, input().split(" ")))
    A = list(map(int, input().split(" ")))
    res = 0
    covered = 0
    while True:
        if covered >= N:
            break
        if res == 0:
            covered = K
        else:
            covered += K - 1
        res += 1
    print(res)

if '__main__' == __name__:
    resolve()
N,K=map(int,input().split())
A=list(map(int,input().split()))
ans = 1
N -= K
while N>0:
  ans += 1
  N -= K-1
print(ans)
import math as m
n,k=map(int,input().split())
a=list(map(int,input().split()))
print(m.ceil((n-1)/(k-1)))
import math
N,K=map(int,input().split())
print(math.ceil((N-1)/(K-1)))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    n, k = map(int, readline().split())
    print((((n-k)+(k-1)-1)//(k-1))+1)
if __name__ == '__main__':
    main()
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)
N,K = list(map(int, input().split()))
A = list(map(int, input().split()))

ans = -(-(N-1) // (K-1))
print(ans)
n,k,*_=map(int,open(0).read().split())
print(0--~-n//~-k)
n,k=map(int,input().split())
a=list(map(int,input().split()))
print((n-1)//(k-1)+1 if (n-1)%(k-1)!=0 else (n-1)//(k-1))
n, k = map(int, input().split())
a = list(map(int, input().split()))


ans = 0
while n > 0:
    if n == k:
        ans += 1
        break
    n -= k - 1
    ans += 1

print(ans)
n, k = map(int, input().split())
a = list(map(int, input().split()))
import math
print(math.ceil((n-1)/(k-1)))
n,k=map(int,input().split())
a=list(map(int,input().split()))
if (n-1)%(k-1)==0:
     print((n-1)//(k-1))
else:
    print((n-1)//(k-1)+1)
n,k = map(int,input().split())
a = list(map(int,input().split()))
p = min(a)
a += [p]
ans,i,temp = 0,0,0
while i<n:
  if a[i]==p:
    m = -(-(i-temp)//(k-1))
    ans += m
    temp += m*(k-1)+1
    i = temp
  else:
    i += 1
ans += -(-(n-temp)//(k-1))
print(ans)
import math
N, K = map(int, input().split())

print(math.ceil((N-1)/(K-1)))
N, K = map(int, input().split())
A = list(map(int, input().split()))

g = 1

while N > K + (K - 1) * (g - 1):
    g += 1
print(g)
print(eval('0--~-'+''.join([i if i!=' 'else'//~-'for i in input()])))
n,k=map(int,input().split())
a=list(map(int,input().split()))
print((n-1+k-2)//(k-1))
n,k = map(int,input().split())
a = list(map(int,input().split()))
x = n-k
if x == 0:
    print(1)
else:
    print(1 + (x+k-2)//(k-1))
# 1回の操作で増やせる1に等しい要素の数はK−1

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))

# ceil(N-1/K-1)
print((N-1+K-2)//(K-1)) # ceil = x+y-1
a,b = map(int,input().split())
c = list(map(int,input().split()))
ans = -(-(a - b) // (b - 1)) + 1
print(ans)
#!/usr/bin/env python3
n, k = map(float, input().split())
ans = -(-(n-1) // (k-1))
print(int(ans))
import math

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

least_g = (N-1) / (K-1)

if least_g.is_integer():
    print(int(least_g))
else:
    print(int(least_g)+1)
N, K = map(int, input().split())
A = list(map(int, input().split()))

ans = 1
ref = K
while ref < N:
    ans += 1
    ref += K-1

print(ans)
import math
n,k = map(int,input().split())
ls = list(map(int,input().split()))
print(math.ceil((n-1)/(k-1)))
import math

N, K = map(int, input().split())
A = list(map(int, input().split()))
idx_minA = A.index(min(A)) + 1

if N <= K:
    print(1)
else:
    ans = float('inf')
    for i in range(max(1, idx_minA - K + 1), idx_minA + 1):
        ans = min(ans, 1 + math.ceil((i - 1) / (K - 1)) + math.ceil((N - (i + K - 1)) / (K - 1)))
    print(ans)
NK = list(map(int,input().split()))
A = list(map(int,input().split()))
N = NK[0]
K = NK[1]

answer = (N - 1) // (K - 1)
remain = (N - 1) % (K - 1)
if remain > 0:
    answer = answer + 1
print(answer)
N,M = map(int,input().split())

ans = (N-1) // (M-1)

if (N-1) % (M-1) != 0:
  ans += 1
  
print(ans)
#101_C
N,K=map(int,input().split())
A=input()
print(-(-(N-1)//(K-1)))
import math
N, K = map(int,input().split())
A = list(map(int,input().split()))
print(math.ceil((N-1)/(K-1)))
input_line = input().split()

num_array = int(input_line[0])
num_equal = int(input_line[1])

input_line = input() # 無視

equalized = 1
i = 0
while equalized < num_array:
    equalized += (num_equal - 1)
    # print(i, equalized)
    i += 1

print(str(i))