Hotel
InterviewTime limit2sMemory limit512 MB
Given a delegation of n people, find the minimum number of double and triple rooms that hold exactly n people with no free beds.
- Level
Easy3 of 10
- Topics
- Math, Brute force, Implementation
- Solved
- No attempts yet
Problem
Many delegations from various cities come to the All-Russian Team Olympiad in Programming for schoolchildren. Housing the delegations in hotel rooms is not an easy task.
A delegation of people has arrived from one large city. The hotel where the delegation is to be housed has only double and triple rooms. To save money, the delegation wants to occupy as few rooms as possible, and the rooms they occupy must have no free places left.
Determine how to place a delegation of people in double and triple rooms so that the total number of rooms used is minimal.
Input
The input file contains a single integer (), the size of the delegation.
Output
Output to the output file two integers and separated by a space: the number of double rooms and triple rooms that must be allocated to the delegation, respectively.