From a66db808f5fb44db2b8d8ca02353fdadd0f5759f Mon Sep 17 00:00:00 2001 From: Denis Costa Date: Wed, 20 Nov 2024 17:24:48 -0300 Subject: [PATCH] Solve Reading Books in python --- solutions/beecrowd/1542/1542.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 solutions/beecrowd/1542/1542.py diff --git a/solutions/beecrowd/1542/1542.py b/solutions/beecrowd/1542/1542.py new file mode 100644 index 00000000..a9bff07c --- /dev/null +++ b/solutions/beecrowd/1542/1542.py @@ -0,0 +1,12 @@ +import math +import sys + +for line in sys.stdin: + if line.strip() == '0': + break + + q, d, p = map(int, line.split()) + total_pages = math.trunc(((d * p) / (p - q)) * q) + + print(f'{total_pages} pagina', end='') + print('s' if total_pages > 1 else '')