AtCoder Beginner Contest 078 - ISU

We have a long seat of width X centimeters.
There are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters.
We would like to seat as many people as possible, but they are all very shy, and there must be a gap of length at least Z centimeters between two people, and between the end of the seat and a person.
At most how many people can sit on the seat?

-----Constraints-----
 - All input values are integers.
 - 1 \leq X, Y, Z \leq 10^5
 - Y+2Z \leq X

-----Input-----
Input is given from Standard Input in the following format:
X Y Z

-----Output-----
Print the answer.

-----Sample Input-----
13 3 1

-----Sample Output-----
3

There is just enough room for three, as shown below:
Figure

Difficulty: EASY

Starter code:

Solutions:
(X, Y, Z) = map(int, input().split(' '))
ans = (X - Z) // (Y + Z)
print(ans)


(x, y, z) = map(int, input().split())
x -= z
r = x // (y + z)
print(r)


(X, Y, Z) = list(map(int, input().split()))
print((X - Z) // (Z + Y))


def answer(x: int, y: int, z: int) -> int:
	return (x - z) // (y + z)

def main():
	(x, y, z) = map(int, input().split())
	print(answer(x, y, z))

def __starting_point():
	main()
__starting_point()


(X, Y, Z) = map(int, input().split())
new = X - Z
print(new // (Y + Z))


(X, Y, Z) = [int(i) for i in input().split()]
print((X - Z) // (Y + Z))


(X, Y, Z) = [int(x) for x in input().split()]
print((X - Z) // (Y + Z))


(X, Y, Z) = map(int, input().split())
left = X - Z
print(left // (Y + Z))


(X, Y, Z) = map(int, input().split())
haba = X - Z
mix = Y + Z
print(int(haba / mix))


(x, y, z) = map(int, input().split())
width = y + z
print((x - z) // width)


(x, y, z) = map(int, input().split())
x -= z
ans = x // (y + z)
rem = x % (y + z)
print(ans)


(X, Y, Z) = list(map(int, input().split()))
ans = 0
for i in range(1, 10 ** 5):
	if X - Y * i - Z * (i + 1) >= 0:
		ans = i
		continue
	else:
		break
print(ans)


(x, y, z) = map(int, input().split())
n = (x - z) // (z + y)
print(n)


(x, y, z) = map(int, input().split())
isu = x - z
print(isu // (z + y))


(X, Y, Z) = map(int, input().split())
N = (X - Z) // (Y + Z)
print(N)


(X, Y, Z) = map(int, input().split())
a = (X - Z) // (Y + Z)
print(a)


(x, y, z) = map(int, input().split())
answer = (x - z) // (y + z)
print(answer)


(x, y, z) = input().split()
print((int(x) - int(z)) // (int(y) + int(z)))


(x, y, z) = list(map(int, input().split()))
x -= z
y += z
print(x // y)


(X, Y, Z) = [int(s) for s in input().split()]
print((X - Z) // (Z + Y))


(x, y, z) = map(int, input().split())
xx = x - z
yy = y + z
print(int(xx / yy))


(x, y, z) = [int(x) for x in input().split()]
print((x - z) // (y + z))


(X, Y, Z) = map(int, input().split())
print((X - (Y + 2 * Z)) // (Y + Z) + 1)


(space, seat, sp) = map(int, input().split())
print((space - sp) // (seat + sp))


(X, Y, Z) = map(int, input().split())
L = X - Z
ans = 0
for i in range(1000000):
	if L >= (Z + Y) * i:
		ans = i
	else:
		break
print(ans)


(A, B, C) = map(int, input().split())
print((A - C) // (B + C))


import math
(X, Y, Z) = list(map(int, input().split()))
X -= Z
print(math.floor(X / (Y + Z)))


a = list(map(int, input().split()))
print((a[0] - a[2]) // (a[1] + a[2]))


(X, Y, Z) = map(int, input().split())
h = X - Z
y = Y + Z
print(h // y)


(x, y, z) = map(int, input().split())
one_length = y + z
print(int((x - z) / one_length))


(x, y, z) = map(int, input().split())
x -= y + 2 * z
print(1 + x // (y + z))


(x, y, z) = map(int, input().split())
w = x - z
print(w // (y + z))


(a, b, c) = list(map(int, input().split()))
d = a - c
print(int(d / (b + c)))


(x, y, z) = map(int, input().split())
l = [z]
per = (x - z) // (y + z)
print(per)


(a, b, c) = map(int, input().split())
print((a - b - c * 2) // (b + c) + 1)


(n, a, b) = [int(i) for i in input().split()]
print((n - b) // (a + b))


(x, y, z) = map(int, input().split())
x -= y + 2 * z
ans = 1
while x - (y + z) >= 0:
	ans += 1
	x -= y + z
print(ans)


(x, y, z) = map(int, input().split())
w = y + z
print(x // w if x % w >= z else x // w - 1)


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
print((a - c) // (b + c))


(X, Y, Z) = map(int, input().split())
n = int((X - Z) / (Y + Z))
print(n)


(x, y, z) = map(int, input().split())
x -= z
count = 0
while x >= y + z:
	x -= y + z
	count += 1
print(count)


(x, y, z) = map(int, input().split())
cnt = 0
length = x - 2 * z
cnt += length // (y + z)
length = length % (y + z)
if y <= length:
	cnt += 1
print(cnt)


def answer(x: int, y: int, z: int) -> int:
	return len(range(y + z * 2, x + 1, y + z))

def main():
	(x, y, z) = map(int, input().split())
	print(answer(x, y, z))

def __starting_point():
	main()
__starting_point()


(x, y, z) = map(int, input().split())
a = x - z
b = a // (y + z)
print(b)


(x, y, z) = list(map(int, input().split()))
ans = 0
for i in range(x):
	if y * i + z * (i + 1) <= x:
		ans = max(ans, i)
print(ans)


x = list(map(int, input().split()))
print(int((x[0] - x[2]) / (x[1] + x[2])))


(X, Y, Z) = [int(i) for i in input().split()]
n = X // (Y + Z)
m = X % (Y + Z)
if m >= Z:
	print(n)
else:
	print(n - 1)


(x, y, z) = map(int, input().split())
for ans in range(1, 100000):
	if ans * y + (ans + 1) * z <= x < (ans + 1) * y + (ans + 2) * z:
		print(ans)
		return


import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce
rr = lambda : sys.stdin.readline().rstrip()
rs = lambda : sys.stdin.readline().split()
ri = lambda : int(sys.stdin.readline())
rm = lambda : list(map(int, sys.stdin.readline().split()))
rl = lambda : list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10 ** 9 + 7
(a, b, c) = rm()
print((a - c) // (b + c))


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(x, y, z) = Input()
	people = x // y
	spaces = (people + 1) * z
	while True:
		if people * y + spaces <= x:
			print(people)
			return
		people -= 1
		spaces = (people + 1) * z
main()


(x, y, z) = map(int, input().split())
len = x - z
print(len // (y + z))


(x, y, z) = map(int, input().split())
result = 0
while y * result + z * (result + 1) <= x:
	result += 1
print(result - 1)


(x, y, z) = map(int, input().split())
p = (x - z) // (y + z)
print(p)


def main():
	(X, Y, Z) = list(map(int, input().split()))
	rest = X - Z
	c = 0
	while rest > 0:
		rest = rest - Y - Z
		if rest < 0:
			print(c)
			return
		elif rest == 0:
			print(c + 1)
			return
		else:
			c += 1
main()


(X, Y, Z) = [int(_) for _ in input().split()]
print((X - Z) // (Y + Z))


(a, b, c) = (int(i) for i in input().split())
print((a - c) // (b + c))


def main():
	(x, y, z) = list(map(int, input().split()))
	x -= y + z * 2
	ans = 0
	if x < 0:
		return ans
	while x >= 0:
		ans += 1
		x -= y + z
	print(ans)

def __starting_point():
	main()
__starting_point()


(x, y, z) = map(int, input().split())
ret = (x - z) // (y + z)
print(ret)


(x, y, z) = map(int, input().split())
for i in range(100000):
	if (i + 1) * z + i * y > x:
		print(i - 1)
		break


(x, y, z) = list(map(int, input().split()))
i = 1
while True:
	if (y + z) * i + z > x:
		print(i - 1)
		break
	i += 1


(x, y, z) = map(int, input().split())
m = x - z
print(m // (y + z))


lst = input().split()
x = int(lst[0])
y = int(lst[1])
z = int(lst[2])
x -= z
print(x // (y + z))


(X, Y, Z) = (int(T) for T in input().split())
print((X - Z) // (Y + Z))


(x, y, z) = map(int, input().split())
n = [i for i in range(z, x - z, y + z)]
if n[-1] + y + z <= x:
	print(len(n))
else:
	print(len(n) - 1)


(X, Y, Z) = map(int, input().split())
k = (X - Z) // (Z + Y)
print(k)


(x, y, z) = map(int, input().split())
yz = y + z
x -= z
print(x // yz)


(x, y, z) = map(int, input().split())
n = 0
while True:
	if n * y + (n + 1) * z > x:
		print(n - 1)
		return
	n += 1


(X, Y, Z) = map(int, input().split())
r = (X - Z) // (Y + Z)
print(r)


(X, Y, Z) = map(int, input().split())
X_ = X - Z
print(X_ // (Y + Z))


(x, y, z) = map(int, input().split())
res = (x - z) // (y + z)
print(res)


(X, Y, Z) = map(int, input().split())
A = X - Z
B = Y + Z
print(A // B)


(x, y, z) = (int(i) for i in input().split())
ans = 0
while True:
	x -= y + z
	if x - z >= 0:
		ans += 1
	else:
		break
print(ans)


import sys
sys.setrecursionlimit(10 ** 7)

def I():
	return int(sys.stdin.readline().rstrip())

def MI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def LI2():
	return list(map(int, sys.stdin.readline().rstrip()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())

def LS2():
	return list(sys.stdin.readline().rstrip())
(X, Y, Z) = MI()
X -= Z
print(X // (Y + Z))


(X, Y, Z) = map(int, input().split())
m = X - Z
print(m // (Y + Z))


(X, Y, Z) = map(int, input().split())
tmp = X - Z
print(tmp // (Y + Z))


(x, y, z) = map(int, input().split())
print(len(range(z + y, x - z + 1, z + y)))


(x, y, z) = map(int, input().split())
cnt = 1
x -= y + 2 * z
while x >= y + z:
	cnt += 1
	x -= y + z
print(cnt)


(x, y, z) = map(int, input().split())
x -= z
count = x // (y + z)
print(count)


import math
(x, y, z) = map(int, input().split())
print(int(math.floor((x - z) / (y + z))))


(x, y, z) = list(map(int, input().split()))
b = x - z
c = y + z
print(b // c)


(x, y, z) = map(int, input().split())
num = x // (y + z)
if x >= num * y + (num * z + z):
	print(num)
else:
	print(num - 1)


(X, Y, Z) = map(int, input().split())
X = X - Z
A = X / (Y + Z) // 1
print(round(A))


(a, s, d) = map(int, input().split())
print((a - d) // (s + d))


(a, b, c) = map(int, input().split())
for i in range(a):
	if b * (i + 1) + c * (i + 2) > a:
		print(i)
		return


(x, y, z) = map(int, input().split())
ans = 0
i = 1
while 1:
	haba = i * y + (i + 1) * z
	if haba > x:
		break
	else:
		ans = i
	i += 1
print(ans)


(x, y, z) = map(int, input().split())
sum = y + z + z
if x < sum:
	print(0)
else:
	ans = 1
	while sum <= x:
		sum += y + z
		ans += 1
	print(ans - 1)


(x, y, z) = map(int, input().split())
X = x - z
ans = X // (y + z)
print(ans)


(X, Y, Z) = map(int, input().split())
X_new = X - Z
print(int(X_new / (Z + Y)))


(X, Y, Z) = map(int, input().split())
answer = (X - Z) // (Y + Z)
print(answer)


(a, b, c) = map(int, input().split())
a -= c
n = a // (b + c)
print(n)


(X, Y, Z) = map(int, input().split())
p = X - Z
a = Z + Y
ans = p // a
print(ans)


(x, y, z) = map(int, input().split())
ans = 0
print((x - z) // (y + z))


(x, y, z) = [int(i) for i in input().split()]
ans = x // (y + z)
if x - ans * (y + z) < z:
	ans -= 1
print(ans)


(X, Y, Z) = map(int, input().split())
l = X - Z
print(l // (Y + Z))


(a, b, c) = map(int, input().split())
a = a - c
print(round(a // (b + c)))


a = list(map(int, input().split()))
x = 0
count = 0
while a[0] - a[2] >= x:
	x += a[1]
	x += a[2]
	count += 1
print(count - 1)


(x, y, z) = map(int, input().split())
c = (x - z) // (y + z)
print(c)


import sys
sys.setrecursionlimit(10 ** 6)
(x, y, z) = list(map(int, input().split()))
print((x - z) // (y + z))


(x, y, z) = map(int, input().split())
tmp = (x - z) // (y + z)
amari = (x - z) % (y + z)
print(tmp)


(a, b, c) = map(int, input().split())
X = a - c
Y = b + c
print(X // Y)