###Python, 356 characters###
Python, 356 characters
I took a slight hit for reading from the command line:
from sys import argv
x=int(argv[1])
t=argv[3::2]
c=argv[2::2]
n=len(t)
s=[0]*n
d=1
g=1
while d:
i=0
s[i]+=1
while int(c[i])*s[i]>x:
s[i]=0
if i+1>=n:
d=0
else:
i+=1
s[i]+=1
if d and sum(map(lambda y:int(c[y])*s[y],range(n)))==x:
g=0
print zip(t, s)
if g:print"X"
Example input:
python stuff.py 1505 215 'Mixed fruit' 275 'French fries' 335 'Side salad' 355 'Hot wings' 420 'Mozzarella sticks' 580 'Sampler plate'
Output:
[('Mixed fruit', 7), ('French fries', 0), ('Side salad', 0), ('Hot wings', 0), ('Mozzarella sticks', 0), ('Sampler plate', 0)]
[('Mixed fruit', 1), ('French fries', 0), ('Side salad', 0), ('Hot wings', 2), ('Mozzarella sticks', 0), ('Sampler plate', 1)]