Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.

book
Visiting Circus

Groups of schoolchildren wants to visit Circus after their lessons. Each group consists of a certain number of children (between 1 and 4), and all children in a group must travel together in the same taxi. Each taxi can hold up to four passengers, and multiple groups can share a taxi as long as the capacity allows. Find the minimum number of taxis needed to transport all the children without splitting any group.

Example 1

Input:

[1, 2, 4, 3, 3]

Output:

4
main.cpp

main.cpp

C++

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt