using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var c = int.Parse(line[0]); var y = int.Parse(line[1]); getAns(c, y); } static int[] getArray(int y, int[] t) { var a = new int[6]; for (int i = 0; i < 6; i++) { a[i] = y / t[i]; y -= a[i] * t[i]; } Array.Reverse(a); return a; } static void getAns(int c, int y) { var t = new int[] { 10000, 5000, 2000, 1000, 500, 100 }; if (c * 100 > y) { Console.WriteLine("can't exchange"); return; } var a = getArray(y, t); if (a[0] + a[1] >= c) { Console.WriteLine("no exchange"); return; } c -= a[0]; Console.WriteLine((c + 4) / 5 * 5); } }