0% found this document useful (0 votes)
82 views4 pages

DO NOT: Container

Bibi needs to transport N cubes in containers for Jojo's birthday party. The cubes have size S and the only available containers have dimensions A x B x C. Bibi wants to minimize the number of containers used. The problem is to calculate the fewest number of containers needed.

Uploaded by

Muhammad Rafif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views4 pages

DO NOT: Container

Bibi needs to transport N cubes in containers for Jojo's birthday party. The cubes have size S and the only available containers have dimensions A x B x C. Bibi wants to minimize the number of containers used. The problem is to calculate the fewest number of containers needed.

Uploaded by

Muhammad Rafif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

E

COMP6047 – Algorithm and Programming

T
T
NO
BU
Container
Today is Jojo’s birthday. To prepare the birthday party, Jojo asks Bibi to bring N cubes
with edge length S for the game on his birthday party. The only idea that came up to
Bibi’s mind is to bring the cubes with rectangular box containers.

I
Then Bibi went to a store. The only container available in the store is a container with

R
O
size A × B × C. Bibi is a thrifty person. Therefore, she wants to buy the minimum
number of containers so that she can load all the cubes.
T
As a good friend of Bibi, help her to calculate the minimum numbers of containers she
D

must buy.
S
Format Input
DI

In this case, the input of this problem starts with a line contains 5 integers N S A B C
consecutively as the number of cubes, the edge length of cube, the length of the container,
the width of the container, and the height of the container.
OT
UT
Format Output
RE

The output of this problem consists of an integer describing the minimum number of
containers Bibi must buy.

Constraints
N
IB
• 1 ≤ N ≤ 109
• 1 ≤ A, B, C ≤ 1000
• 1 ≤ S ≤ M IN (A, B, C)
TR
DO

Sample Input 1 (standard input)


24 4 8 8 8
IS

Sample Output 1 (standard output)


3
ED

c School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.
E
COMP6047 – Algorithm and Programming

T
T
Sample Input 2 (standard input)

NO
BU
27 3 8 4 10

Sample Output 2 (standard output)


5

R I
O
T
D
S
DI

OT
UT
RE

N
IB
TR
DO
IS
ED

c School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.
E
COMP6047 – Algorithm and Programming

T
T
NO
BU
Container
Hari ini adalah hari ulang tahun Jojo. Untuk mempersiapkan pesta ulang tahunnya,
Jojo menugaskan Bibi untuk membawakan N buah kubus dengan panjang rusuk S
untuk permainan di pesta ulang tahunnya. Cara yang terpikirkan oleh Bibi yaitu dengan

I
menampung kubus-kubus tersebut kedalam beberapa kontainer yang berbentuk balok.

R
O
Bibi pun pergi ke toko untuk membeli kontainer. Toko hanya menyediakan kontainer
dengan ukuran A × B × C. Bibi adalah orang yang sangat hemat, sehingga dia hanya
ingin membeli kontainer secukupnya supaya bisa menampung seluruh kubus yang ada.
T
D

Sebagai teman baik Bibi, bantulah Bibi menghitung berapa kontainer minimum yang
harus Bibi beli.
S
DI

Format Input
Pada kesempatan kali ini, input soal ini terdiri dari satu baris berisi 5 buah bilangan
bulat N S A B C yang secara berurutan menunjukan banyak kubus, panjang rusuk
OT
kubus, panjang kontainer, lebar kontainer, dan tinggi kontainer.

UT
RE

Format Output
Untuk mempersingkat waktu, output soal ini terdiri dari sebuah bilangan bulat menjelaskan
banyaknya kontainer minimum yang harus dibeli Bibi sesuai dengan deskripsi di atas.
N
IB
Constraints
• 1 ≤ N ≤ 109

• 1 ≤ A, B, C ≤ 1000
TR
DO

• 1 ≤ S ≤ M IN (A, B, C)

Sample Input 1 (standard input)


24 4 8 8 8
IS
ED

c School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.
E
COMP6047 – Algorithm and Programming

T
T
Sample Output 1 (standard output)

NO
BU
3

Sample Input 2 (standard input)


27 3 8 4 10

R I
O
Sample Output 2 (standard output)
5
T
D
S
DI

OT
UT
RE

N
IB
TR
DO
IS
ED

c School of Computer Science - BINUS, 2020. No part of the materials available may be copied,
photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form,
in whole or in part, without prior written consent of School of Computer Science - BINUS. Any other
reproduction in any form without the permission of School of Computer Science - BINUS is probihited.
For those who violated this disclaimer, academic sanctioned can be enforced.

You might also like