Posible combinations of available rooms I have $x$ people to divide over different type of rooms.
Possible rooms: 


*

*$1$ person bedroom normal view; 

*$1$ person bedroom sea view;

*$2$ person bedroom


For $x = 4$
Possible combinations are
$$(0,0,2),  
(0 ,2, 1),  
(2 ,0, 1),  
(1 ,1, 1),  
(4 ,0, 0),  
(3 ,1, 0),  
(2 ,2, 0),
(1 ,3 ,0),
(0 ,4, 0)$$
Note : Plenty of rooms are available. 
How can I get all posible combinations?
 A: You can solve this using generating function such as this
Bedroom 1 can be 0,1,2,3,4
Bedroom 2 can be 0,1,2,3,4
Bedroom 3 can be 0,2,4
Translating this into generating function and the number of combinations would be the coefficient of $x^4$
Thus the above problem could be translated into $(1+x+x^2+x^3+x^4)^2(1+x^2+x^4)$ and finding the coefficient of $x^4$
The product is given from Wolfram Alpha as
$x^{12}+2 x^{11}+4 x^{10}+6 x^9+9 x^8+10 x^7+11 x^6+10 x^5+$***9***$x^4+6 x^3+4 x^2+2 x+1$
Thanks 
Satish
A: Are you interested in the number of compositions, or the list of compositions itself?
The number of compositions can be obtained using generating functions.  I assume, as in your example, that a two-person bedroom cannot be occupied by a single person.  The number of compositions for $n$ people is the coefficient of $y^n$ in the expansion of
$$
\frac{1}{(1-y)^2(1-y^2)}=\frac{(1+y)^2}{(1-y^2)^3}=(1+2y+y^2)\sum_{j=0}^\infty\frac{(-3)(-2)\ldots(-j-2)}{j!}(-y^2)^j.
$$
The expression on the left comes from interpreting $\frac{1}{1-y}$ as $1+y+y^2+\ldots$ and $\frac{1}{(1-y^2)}$ as $1+y^2+y^4+\ldots$ and realizing that the coefficient of $y^n$ when the three factors are multiplied out is exactly the number of whole-number solutions to $a+b+2c=n.$  The middle expression comes from writing $\frac{1}{1-y}$ as $\frac{1+y}{(1-y)(1+y)}.$  The expression on the right is obtained using the binomial theorem.
With some further manipulations, the generating function becomes
$$
(1+2y+y^2)\sum_{j=0}^\infty\binom{j+2}{j}y^{2j}=(1+2y+y^2)\sum_{j=0}^\infty\binom{j+2}{2}y^{2j}.
$$
You can see that when $n$ is even, the coefficient of $y^n$ is $\binom{n/2+2}{2}+\binom{n/2+1}{2}$.  When $n$ is odd, the coefficient is $2\binom{(n-1)/2+2}{2}.$
These answers can be understood using stars-and-bars: if $n$ is even, pair up the people.  So there are $n/2$ pairs.  Either we have an even number of people in all three types of room, in which case there are $\binom{n/2+2}{2}$ compositions, or there is an odd number of people in the single-type rooms, in which case we split one of the pairs, putting one member of the pair in a normal room and the other in a sea-view room, and then find that there are $\binom{n/2+1}{2}$ compositions for the remaining pairs.
If $n$ is odd, we have $(n-1)/2$ pairs, and one single person.  That single person goes either in a normal room or a sea-view room, and there are $\binom{(n-1)/2+2}{2}$ compositions for the pairs.
A: Is what you want an algorithm ?
The easiest is to sort the rooms in descending order of number of beds, and to iterate through all the possibilities to get all of them.
In pseudocode :
sort rooms in descending order
find nb_people rooms

find 0 rooms = [[0 for elt in rooms]]     // Speed-up
find nb_left [room] = if is_integer (nb_people/room) then [[nb_people/room]] else []
find nb_left room:rooms = 
  [[i:l for l in (find (nb_people-room*i) rooms))] for i in (0, floor(nb_people/room))]

Sorting the rooms in descending order maximizes the probability that at the end, the solution will be doable (noone will be left behind).
This can be improved using memoisation to store all the results of find.
