for (a=0; a<=y; a++)
for (b=0; b<=y/2; b++)
for (c=0; c<=y/3; c++)
if ((a + 2*b + 3*c) == y)
count++;