Finally, College has started calling students back to campus. There are so many students and thus due to some safety measures the college can’t call back all the students on the same day. It currently has the capacity of screening K students on a single day. There is a total of N students. What's the minimum number of days required for all the students to be back on the campus?

------ Input Format ------ 

- The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
- The first and only line of each test case contains two space-separated integers N, K.

------ Output Format ------ 

For each test case, print a single line containing one integer - the minimum number of days required for all the students to be back on the campus.

------ Constraints ------ 

$1 ≤ T ≤ 10^{4}$
$1 ≤ N ≤ 10^{2}$
$1 ≤ K ≤ 10^{2}$

----- Sample Input 1 ------ 
3
3 3
3 2
4 3

----- Sample Output 1 ------ 
1
2
2

----- explanation 1 ------ 
Test case 1: Since $K = 3$ and $N = 3$, we can call all $3$ students back to campus on the first day itself. Hence it requires only $1$ day for all students to be back on campus.

Test case 2: We have $K = 2$ and $N = 3 > K$, so we can't call all the students back to campus on a single day. But we can call $1$ student on the first day and the remaining $2$ students on the second day. Therefore, we require a minimum of $2$ days for all students to be back on campus.

Test case 3: We have $K = 3$ and $N = 4 > K$, so we can't call all the students back to campus on a single day. But we can call $2$ students on the first day and the remaining $2$ students on the second day. Therefore, we require a minimum of $2$ days for all students to be back on campus.

Source: codechef | Difficulty: EASY
Tags: Mathematics

Implementation

Complete search


Solutions:
T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	result_mod = N % K
	result_floordiv = N // K
	if N <= K:
		print(1)
	elif N > K:
		if result_mod == 0:
			print(result_floordiv)
		elif result_mod != 0:
			print(result_floordiv + 1)


import math as m
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	print(m.ceil(n / k))


import math
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	days = math.ceil(n / k)
	print(days)


t = int(input())
for i in range(t):
	(N, K) = map(int, input().split())
	if N % K == 0:
		print(N // K)
	else:
		print(N // K + 1)


import math
T = int(input())
for i in range(T):
	(N, K) = map(int, input().split())
	print(math.ceil(N / K))


import math
for i in range(int(input())):
	(n, k) = map(int, input().split())
	print(math.ceil(n / k))


def min_days(n, k):
	if n <= k:
		return 1
	elif n % k == 0:
		return n // k
	else:
		return n // k + 1
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	print(min_days(n, k))


n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	if a % b == 0:
		print(a // b)
	else:
		print(a // b + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	d = int(n / k)
	if n % k == 0:
		print(d)
	else:
		print(d + 1)


for testcases in range(int(input())):
	(total, min_students) = map(int, input().split())
	if total % min_students == 0:
		print(total // min_students)
	else:
		print(total // min_students + 1)


import math
t = int(input())
for i in range(t):
	ans = 0
	(n, k) = list(map(int, input().split(' ')))
	ans = math.ceil(n / k)
	print(ans)


for _ in range(int(input())):
	(N, K) = map(int, input().split())
	if N % K == 0:
		print(N // K)
	else:
		print(N // K + 1)


import math
n = int(input())
for i in range(n):
	(a, b) = list(map(int, input().split()))
	print(math.ceil(a / b))


for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if a % b == 0:
		print(a // b)
	else:
		print(a // b + 1)


import math as m
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	print(m.ceil(a / b))


from math import ceil
T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	print(ceil(N / K))


import math
t = int(input())
for i in range(t):
	(a, b) = map(int, input().split())
	print(math.ceil(a / b))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	if n % k == 0:
		print(n // k)
	else:
		print(n // k + 1)


for i in range(int(input())):
	(n, k) = list(map(int, input().split()))
	if n % k == 0:
		print(int(n // k))
	else:
		print(int(n // k + 1))


t = int(input())
for i in range(0, t):
	(m, n) = map(int, input().split(' '))
	if m % n == 0:
		print(m // n)
	if m % n != 0:
		print(m // n + 1)


try:
	t = int(input())
	for r in range(t):
		(n, k) = map(int, input().split())
		if n % k == 0:
			print(n // k)
		else:
			print(n // k + 1)
except:
	pass


import math
for i in range(int(input())):
	(total, capacity) = map(int, input().split())
	print(math.ceil(total / capacity))


for i in range(int(input())):
	(x, y) = map(int, input().split())
	if x % y == 0:
		print(x // y)
	else:
		print(x // y + 1)


t = int(input())
for t in range(t):
	lis = list(map(int, input().split()))
	(a, b) = lis
	if a % b == 0:
		print(int(a / b))
	else:
		print(int(a / b) + 1)


t = int(input())
while t != 0:
	(n, x) = list(map(int, input().split()))
	if n <= x:
		print('1')
	elif n % x == 0:
		print(n // x)
	else:
		print(n // x + 1)
	t = t - 1


T = int(input())
for tc in range(T):
	(n, k) = map(int, input().split())
	if n % k == 0:
		print(n // k)
	else:
		print(n // k + 1)


import math
for i in range(int(input())):
	(x, y) = map(int, input().split())
	print(math.ceil(x / y))


for i in range(int(input())):
	(N, K) = map(int, input().split())
	c = 0
	while N > 0:
		c += 1
		N -= K
	print(c)


import math
tc = int(input())
for _ in range(tc):
	(a, b) = map(int, input().split())
	print(math.ceil(a / b))


import math
i = int(input())
x = 0
list1 = []
while x < i:
	oo = input().split()
	nd = int(oo[0]) / int(oo[1])
	if nd % 1 > 0:
		nd = math.floor(nd) + 1
	list1.append(int(nd))
	x = x + 1
for ele in list1:
	print(ele)


t = int(input())
for i in range(t):
	(n, k) = [int(i) for i in input().split()]
	if k >= n:
		print(1)
	else:
		days = n // k
		if n % k != 0:
			print(days + 1)
		else:
			print(days)