livepython.net

163. Python Program to Find How Many Boxes You Need Using math.ceil

Easymath

Overview

A real job for rounding up: a half-full box is still a box.

Problem Statement

Read how many items there are, then how many items fit in one box (both whole numbers, 1 or more). Print how many boxes are needed and how many free spaces are left in them. For example, 20 items and 6 per box:

Boxes needed: 4
Free spaces: 4

Three boxes hold only 18 items, so a fourth box is needed, and 24 - 20 = 4 spaces stay free.

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

Two whole numbers, one per line. Example:

20
6

Output

The output for that example:

Boxes needed: 4
Free spaces: 4

The tests try 4 different inputs.

Learn this firstChapter 18 · Python math Module: sqrt, pi, ceil and floor
solution.py
# write your code here

EXPECTED OUTPUT

1Boxes needed: 4
2Free spaces: 4

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.