using System.Collections.Generic;
public static void Main()
var ints = new List<int>{1,2,5,8};
var otherInts = new List<int>{3,4,9};
var intsImmediatelyLessThanOrEqualToOtherInts = from i in ints
let firstGreaterOtherInt = otherInts.First(o => o > i)
let intBetweenThisAndOther = from i2 in ints
where i2 > i && i2 < firstGreaterOtherInt
select intBetweenThisAndOther.Count() > 0 ? null as object : i;
intsImmediatelyLessThanOrEqualToOtherInts.Where(i => i != null).ToList().ForEach(Console.WriteLine);