System. Collections. Generic


Download 12.57 Kb.
Sana21.09.2020
Hajmi12.57 Kb.
#130622
Bog'liq
524 2


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;
namespace _524

{

class Program

{

static void Main(string[] args)

{

int m, n, x, y, a, b;

string[] s = Console.ReadLine().Split(' ');

m = int.Parse(s[0]);

n = int.Parse(s[1]);

x = int.Parse(s[2]);

y = int.Parse(s[3]);

if (m == n && n == x && x == y) Console.WriteLine(0);else

if ((m + n) % 2 == 0 && (x + y) % 2 == 0 || (m + n) % 2 == 1 && (x + y) % 2 == 1)

{

if (Math.Abs(m - x) == Math.Abs(y - n)) Console.WriteLine(1);

else

{

Console.WriteLine(2);

a = (x + y + m - n) / 2;

b = (x + y + n - m) / 2;

if (a < 9 && a > 0 && b < 9 && b > 0) Console.WriteLine(a + " " + b);

else Console.WriteLine((m + n + x - y) / 2 + " " + (m + n + y - x) / 2);

}

}

else Console.WriteLine(0);


}

}

}
Download 12.57 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling