Var i,j,k:integer;
begin
k:=0;
for i:=0 to 47 do
for j:=0 to 47-i do
if 360-(3*i+6*j)=9*(47-i-j) then
begin writeln(i,' ',j,' ',47-i-j);k:=k+1; end;
writeln('k = ',k);
end.
Результат:
0 21 26
1 19 27
2 17 28
3 15 29
4 13 30
5 11 31
6 9 32
7 7 33
8 5 34
9 3 35
10 1 36
k = 11