using System; public class Hello { public static long a, b, n, m; static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); a = long.Parse(line[0]); b = long.Parse(line[1]); n = long.Parse(line[2]); m = long.Parse(line[3]); getAns(); } static void getAns() { if (a == b) { Console.WriteLine(a); return; } long ans; if (a > b) ans = b + (a - b) / (n + 1); else ans = a + (b - a) / (m + 1); Console.WriteLine(ans); } }