using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ex08_6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int men, women, children;
            men = 0;
            while (men <= 8)
            {
                women = 0;
                while (women <= 11)
                {
                    children = 36 - men - women;
                    if (4 * men + 3 * women + children / 2 == 36)
                    {
                        textBox1.Text = men.ToString();
                        textBox2.Text = women.ToString();
                        textBox3.Text = children.ToString();
                    }
                    women++;
                }
                men++;
            }
        }
    }
}
