using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int m = 44; for (int x = 0; x<=m/6; x++) { if (((39 - 6*x)%5)==0) { Console.WriteLine("Табуретки: "+x+", стільці: "+(m-6*x)/5); } } } } }