using System;
using System.IO;
namespace _1085
{
class Program
{
static void Main()
{
StreamReader sr = new StreamReader(Console.OpenStandardInput());
StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
string[] arrString = sr.ReadLine().Split(' ');
int x = int.Parse(arrString[0]);
int y = int.Parse(arrString[1]);
int w = int.Parse(arrString[2]);
int h = int.Parse(arrString[3]);
int minX = x < (w - x) ? x : (w - x);
int minY = y < (h - y) ? y : (h - y);
int min = minX<minY?minX:minY;
sw.WriteLine(min);
sr.Close();
sw.Flush();
sw.Close();
}
}
}
'알고리즘 > 백준 BOJ' 카테고리의 다른 글
[BOJ C#] 5585 거스름돈 (0) | 2023.01.27 |
---|---|
[BOJ C#] 1259 팰린드롬수 (0) | 2023.01.26 |
[BOJ C#] 4153 직각삼각형 (0) | 2023.01.25 |
[BOJ C#] 10250 ACM 호텔 (0) | 2023.01.25 |
[BOJ C#] 2798 블랙잭 (0) | 2023.01.25 |