注意输入读取方法和输出格式 !
import java.util.Scanner;
/**
* author:djch
* date:2021/5/26
*
* @author djch*/
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s = scanner.nextLine();
Scanner sc = new Scanner(s); //使Scanner可终止
boolean bool = false; //空格输出标记
int a = 0;
int b = 0;
while(sc.hasNextInt()){
a = sc.nextInt();
b = sc.nextInt();
if(b==0){continue;}
if(b!=0) {
if (bool) {
System.out.print(" ");
}
System.out.print(a * b + " " + (b - 1));
}
if(sc.hasNextInt()){
bool = true;
}
}
if(!bool){
System.out.print("0 0");
}
}
}