728x90
▶3733 - Shares
▶문제
A group of N persons and the ACM Chief Judge share equally a number of S shares (not necessary all of them). Let x be the number of shares aquired by each person (x must be an integer). The problem is to compute the maximum value of x.
Write a program that reads pairs of integer numbers from an input text file. Each pair contains the values of 1 ≤ N ≤ 10000 and 1 ≤ S ≤ 109 in that order. The input data are separated freely by white spaces, are correct, and terminate with an end of file. For each pair of numbers the program computes the maximum value of x and prints that value on the standard output from the beginning of a line, as shown in the example below.
▶풀이
result = []
while True:
try:
n, x = map(int, input().split())
result.append(x // (n + 1))
except:
for x in result:
print(x)
break
728x90
'BOJ Code > Bronze_Silver' 카테고리의 다른 글
[백준/BOJ] silver1 - 2529번 부등호 (Python) (0) | 2022.12.17 |
---|---|
[백준/BOJ] bronze5 - 4999번 아! (Python) (0) | 2022.11.27 |
[백준/BOJ] bronze5 - 4101번 크냐? (Python) (0) | 2022.11.27 |
[백준/BOJ] bronze5 - 3003번 킹, 퀸, 룩, 비숍, 나이트, 폰 (Python) (0) | 2022.11.27 |
[백준/BOJ] bronze5 - 2338번 긴자리 계산 (Python) (2) | 2022.11.27 |