using System; public class Hello { public static void Main() { var w = long.Parse(Console.ReadLine().Trim()); var d = long.Parse(Console.ReadLine().Trim()); var a = 0L; var imax = (long)Math.Min(d, Math.Sqrt(w) + 1); for (long i = imax; i >= 1; i--) { a = w / (i * i); w -= a; } Console.WriteLine(a); } }