1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import java.util.Scanner; /** * UVA10170 */ public class UVA10170 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { long S = sc.nextLong(), D = sc.nextLong(); for (long i = S; i < D; i += S) S++; System.out.println(S); } sc.close(); } } |