using System;
public class Test
{
public static void Main()
{
Console.WriteLine(Max(1, 1));
Console.WriteLine(Max(1, 2));
Console.WriteLine(Max(2, 1));
Console.WriteLine(Max(1, null));
Console.WriteLine(Max(null, 1));
Console.WriteLine(Max(null, null));
}
public static int? Max (int? a, int? b)
{
return a > b ? a : b ?? a;
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCUNvbnNvbGUuV3JpdGVMaW5lKE1heCgxLCAxKSk7CgkJQ29uc29sZS5Xcml0ZUxpbmUoTWF4KDEsIDIpKTsKCQlDb25zb2xlLldyaXRlTGluZShNYXgoMiwgMSkpOwoJCUNvbnNvbGUuV3JpdGVMaW5lKE1heCgxLCBudWxsKSk7CgkJQ29uc29sZS5Xcml0ZUxpbmUoTWF4KG51bGwsIDEpKTsKCQlDb25zb2xlLldyaXRlTGluZShNYXgobnVsbCwgbnVsbCkpOwoJfQoJCglwdWJsaWMgc3RhdGljIGludD8gTWF4IChpbnQ/IGEsIGludD8gYikKCXsKCQlyZXR1cm4gYSA+IGIgPyBhIDogYiA/PyBhOwoJfQp9