private void Ar3Clicked(object sender, EventArgs e)
        {
            if (badData(TextBox1.Text, TextBox2.Text))
            {
                return;
            }
            long n = Convert.ToInt64(TextBox1.Text);
            long p = Convert.ToInt64(TextBox2.Text);

            if (!goodData((ulong)n, (ulong)p))
            {
                return;
            }

            string log = string.Empty;

            long ks = p % 10;

            if ((ks == 1) || (ks == 9))
            {
                ks = 10 - ks;
            }

            long q  = ((p * ks) + 1) / 10;
            long qs = Math.Abs(p - q);

            string log0 = string.Empty;

            if ((ks == 3) || (ks == 7))
            {
                log0 = "k=" + p % 10 + " => ks=k=" + ks;
            }
            if ((ks == 9) || (ks == 1))
            {
                log0 = "k=" + p % 10 + " => ks=10-k=" + ks;
            }
            log0 += "\n";
            string log1 = "q=(" + p + "*" + ks + "+1)/10=" + q + ";\n";
            string log2 = "qs=|" + p + "-" + q + "|=" + qs + "\n";

            Arachinskiy.Ar3(n, p, qs, ref log);

            Solution.Text = log0 + log1 + log2 + log;
        }
        private void Ar1Clicked(object sender, EventArgs e)
        {
            if (badData(TextBox1.Text, TextBox2.Text))
            {
                return;
            }

            long   n   = Convert.ToInt64(TextBox1.Text);
            long   p   = Convert.ToInt64(TextBox2.Text);
            string log = string.Empty;

            if (!goodData((ulong)n, (ulong)p))
            {
                return;
            }

            Arachinskiy.Ar1(n, p, ref log);

            this.Solution.Text = log;
        }