using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// アプリケーションのメイン エントリ ポイントです。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form[] forms = new Form[3];
for (int i = 0; i < forms.Length; ++i)
{
forms[i] = new Form();
forms[i].FormClosed += (sender, e) => {
int count = 0;
foreach (Form f in forms)
{
if (f.Visible == false) count++;
}
if (count == 2)
Application.Exit();
};
forms[i].Show();
}
Application.Run();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkxpbnE7CnVzaW5nIFN5c3RlbS5XaW5kb3dzLkZvcm1zOwoKbmFtZXNwYWNlIFdpbmRvd3NGb3Jtc0FwcGxpY2F0aW9uMQp7CiAgICBzdGF0aWMgY2xhc3MgUHJvZ3JhbQogICAgewogICAgICAgIC8vLyA8c3VtbWFyeT4KICAgICAgICAvLy8g44Ki44OX44Oq44Kx44O844K344On44Oz44Gu44Oh44Kk44OzIOOCqOODs+ODiOODqiDjg53jgqTjg7Pjg4jjgafjgZnjgIIKICAgICAgICAvLy8gPC9zdW1tYXJ5PgogICAgICAgIFtTVEFUaHJlYWRdCiAgICAgICAgc3RhdGljIHZvaWQgTWFpbigpCiAgICAgICAgewogICAgICAgICAgICBBcHBsaWNhdGlvbi5FbmFibGVWaXN1YWxTdHlsZXMoKTsKICAgICAgICAgICAgQXBwbGljYXRpb24uU2V0Q29tcGF0aWJsZVRleHRSZW5kZXJpbmdEZWZhdWx0KGZhbHNlKTsKICAgICAgICAgICAgRm9ybVtdIGZvcm1zID0gbmV3IEZvcm1bM107CgogICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGZvcm1zLkxlbmd0aDsgKytpKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBmb3Jtc1tpXSA9IG5ldyBGb3JtKCk7CiAgICAgICAgICAgICAgICBmb3Jtc1tpXS5Gb3JtQ2xvc2VkICs9IChzZW5kZXIsIGUpID0+IHsKICAgICAgICAgICAgICAgICAgICBpbnQgY291bnQgPSAwOwogICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKEZvcm0gZiBpbiBmb3JtcykKICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLlZpc2libGUgPT0gZmFsc2UpIGNvdW50Kys7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PSAyKQogICAgICAgICAgICAgICAgICAgICAgICBBcHBsaWNhdGlvbi5FeGl0KCk7CiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgZm9ybXNbaV0uU2hvdygpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBBcHBsaWNhdGlvbi5SdW4oKTsKICAgICAgICB9CiAgICB9Cn0K