publicclassMain { publicstaticvoidmain(String[] args) { Scannerinput=newScanner(System.in); int a, b; a = input.nextInt(); b = input.nextInt(); if (b == 0) { System.out.print("0 0"); return; } else System.out.printf("%d %d", a * b, b - 1); while (input.hasNextInt()) { a = input.nextInt(); b = input.nextInt(); if (b != 0) System.out.printf(" %d %d", a * b, b - 1); }