Read problem statements in [Vietnamese],
[Bengali], [Mandarin Chinese], and [Russian] as well. 

Chefland has 2 different types of coconut, type A and type B. Type A contains only x_{a} milliliters of coconut water and type B contains only x_{b} grams of coconut pulp. Chef's nutritionist has advised him to consume X_{a} milliliters of coconut water and X_{b} grams of coconut pulp every week in the summer. Find the total number of coconuts (type A + type B) that Chef should buy each week to keep himself active in the hot weather.

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

- The first line contains an integer T, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, four integers x_{a}, x_{b}, X_{a}, X_{b}.

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

For each test case, output in a single line the answer to the problem.

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

$1 ≤ T ≤ 15000$
$100 ≤ x_{a} ≤ 200$
$400 ≤ x_{b} ≤ 500$
$1000 ≤ X_{a} ≤ 1200$
$1000 ≤ X_{b} ≤ 1500$
$x_{a}$ divides $X_{a}$.
$x_{b}$ divides $X_{b}$.

------ subtasks ------ 

Subtask #1 (100 points): original constraints

----- Sample Input 1 ------ 
3
100 400 1000 1200
100 450 1000 1350
150 400 1200 1200
----- Sample Output 1 ------ 
13
13
11
----- explanation 1 ------ 
TestCase $1$: 
Number of coconuts of Type $A$ required = $\frac{1000}{100} = 10$ and number of coconuts of Type $B$ required = $\frac{1200}{400} = 3$.  So the total number of coconuts required is $10 + 3 = 13$.

TestCase $2$: 
Number of coconuts of Type $A$ required = $\frac{1000}{100} = 10$ and number of coconuts of Type $B$ required = $\frac{1350}{450} = 3$.  So the total number of coconuts required is $10 + 3 = 13$.

TestCase $3$: 
Number of coconuts of Type $A$ required = $\frac{1200}{150} = 8$ and number of coconuts of Type $B$ required = $\frac{1200}{400} = 3$.  So the total number of coconuts required is $8 + 3 = 11$.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
for i in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	a = c // a
	b = d // b
	print(a + b)


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


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


n = int(input())
for i in range(n):
	(p, q, a, b) = map(int, input().split())
	print(a // p + b // q)


for i in range(int(input())):
	(a, b, x, y) = map(int, input().split())
	print(x // a + y // b)


T = int(input())
for i in range(T):
	(x1, x2, X1, X2) = map(int, input().split())
	print(X1 // x1 + X2 // x2)


for i in range(int(input())):
	(a, b, A, B) = map(int, input().split())
	print(A // a + B // b)


for i in range(int(input())):
	(xa, xb, Xa, Xb) = map(int, input().split())
	print(int(Xa / xa + Xb / xb))


t = int(input())
for i in range(t):
	(xa, xb, a, b) = map(int, input().split())
	r1 = a // xa
	r2 = b // xb
	print(r1 + r2)


t = int(input())

def di(a, b):
	if b % a == 0:
		return int(b / a)
	else:
		return int(b / a) + 1
for i in range(t):
	(x, y, z, a) = map(int, input().split(' '))
	c = di(x, z) + di(y, a)
	print(c)


t = int(input())
for i in range(t):
	(x, y, d, s) = map(int, input().split())
	print(d // x + s // y)


n = int(input())
for _ in range(n):
	(xa, xb, XA, XB) = list(map(int, input().split()))
	print(XA // xa + XB // xb)


n = int(input())
for i in range(n):
	a = list(map(int, input().split(' ')))
	t = 0
	if a[2] % a[0] == 0:
		t += a[2] // a[0]
	else:
		t += a[2] // a[0] + 1
	if a[3] % a[1] == 0:
		t += a[3] // a[1]
	else:
		t += a[3] // a[1] + 1
	print(t)


t = int(input())
for _ in range(t):
	(a, b, c, d) = map(int, input().split())
	x1 = c // a
	x2 = d // b
	print(x1 + x2)


T = int(input())
for i in range(T):
	(x1, x2, x3, x4) = list(map(int, input().split()))
	y1 = x3 // x1
	y2 = x4 // x2
	print(y1 + y2)


t = int(input())
for i in range(t):
	(x, y, z, a) = map(int, input().split())
	b = z // x
	c = a // y
	print(b + c)


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


t = int(input())
for i in range(t):
	(x1, x2, Y1, Y2) = map(int, input().split())
	print(Y1 // x1 + Y2 // x2)


t = int(input())
for tc in range(t):
	(a, b, c, d) = map(int, input().split())
	print(c // a + d // b)


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	r1 = c // a
	r2 = d // b
	print(r1 + r2)


for i in range(int(input())):
	(w, x, y, z) = map(int, input().split(' '))
	print(y // w + z // x)


t = int(input())
for i in range(t):
	l = list(map(int, input().split()))
	print(l[2] // l[0] + l[3] // l[1])


t = int(input())
for i in range(t):
	(a, b, x, y) = map(int, input().split())
	if x % a == 0:
		tota = x // a
	elif x % a != 0:
		tota = x // a + 1
	if y % b == 0:
		totb = y // b
	elif y % b != 0:
		totb = y // b + 1
	print(tota + totb)


num = int(input())
for i in range(num):
	(x, y, z, p) = map(int, input().split())
	print(z // x + p // y)


for i in range(int(input())):
	(d, w, a, r) = map(int, input().split())
	print(a // d + r // w)


for i in range(int(input())):
	(a, b, c, d) = [int(i) for i in input().split()]
	r = c // a
	t = d // b
	print(r + t)


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


import math
t = int(input())
i = 1
while i <= t:
	(za, zb, xa, xb) = map(int, input().split())
	i = i + 1
	if xa % za == 0 and xb % zb == 0:
		print(xa // za + xb // zb)
	else:
		print('invalid')


def sh(x1, y1, x2, y2):
	g = x2 // x1 + y2 // y1
	print(g)
t = int(input())
for i in range(t):
	(a1, b1, a2, b2) = map(int, input().split())
	ans = sh(a1, b1, a2, b2)


T = int(input())
for _ in range(T):
	(xa, xb, XA, XB) = map(int, input().split())
	TypeA = XA // xa
	TypeB = XB // xb
	print(TypeA + TypeB)


t = int(input())
for _ in range(t):
	(xa, xb, Xa, Xb) = list(map(int, input().split()))
	print(Xa // xa + Xb // xb)


for i in range(int(input())):
	(xa, xb, x1, x2) = map(int, input().split())
	c = int(x1 / xa)
	d = int(x2 / xb)
	print(c + d)


import math

def solution():
	pass
T = int(input())
for _ in range(T):
	(A, B, C, D) = map(int, input().split())
	print(C // A + D // B)


t = int(input())
for i in range(t):
	(a, b, c, d) = map(int, input().split())
	e = c // a
	f = d // b
	print(e + f)


def code():
	cases = int(input())
	for _ in range(cases):
		(a_mili, b_water, Xa, Xb) = map(int, input().split(' '))
		type_A_coco = Xa / a_mili
		type_B_coco = Xb / b_water
		print(int(type_A_coco + type_B_coco))
code()


t = int(input())
while t > 0:
	t = t - 1
	(a, b, c, d) = map(int, input().split())
	if c % a != 0:
		i = c // a + 1
	else:
		i = c // a
	if d % b != 0:
		j = d // b + 1
	else:
		j = d // b
	print(i + j)


for _ in range(int(input())):
	(x1, x2, xa, xb) = map(int, input().split())
	a = xa // x1
	b = xb // x2
	print(a + b)


t = int(input())
for i in range(t):
	(xa, xb, ya, yb) = map(int, input().split())
	type_a = ya / xa
	type_b = yb / xb
	print(int(type_a + type_b))


t = int(input())
for i in range(t):
	(xa, xb, Xa, Xb) = map(int, input().split())
	x = Xa // xa
	y = Xb // xb
	z = x + y
	print(z)


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


t = int(input())
for i in range(t):
	(ca, cb, xa, xb) = map(int, input().split())
	ta = xa // ca
	tb = xb // cb
	print(ta + tb)


t = int(input())
for i in range(t):
	(ca, cb, xa, xb) = map(int, input().split())
	ta = xa // ca
	if xa % ca != 0:
		ta = ta + 1
	tb = xb // cb
	if xb % cb != 0:
		tb = tb + 1
	print(ta + tb)


T = int(input())
for i in range(T):
	(a, b, A, B) = map(int, input().split())
	typeA = A // a
	typeB = B // b
	print(typeA + typeB)


t = int(input())
for i in range(t):
	(cocoA, cocoB, nutriA, nutriB) = map(int, input().split())
	n_buy_a = int(nutriA / cocoA)
	n_buy_b = int(nutriB / cocoB)
	print(n_buy_b + n_buy_a)


tests = int(input())
while tests:
	(xa, xb, Ta, Tb) = [int(i) for i in input().split(' ')]
	(ca, cb) = (Ta // xa + Ta % xa, Tb // xb + Tb % xb)
	print(ca + cb)
	tests -= 1


t = int(input())
while t:
	t -= 1
	(a, b, c, d) = map(int, input().split())
	print(c // a + d // b)


n = int(input())
for i in range(n):
	(w, x, y, z) = map(int, input().split())
	a = int(y / w)
	b = int(z / x)
	print(a + b)


for _ in range(int(input())):
	(a, b, c, d) = map(int, input().split())
	m = c // a
	n = d // b
	print(m + n)