我写的没啥技术含量
#include <iostream>
int main() {
using namespace std;
int a,b;
while(cin>>a>>b){
if(b!=0&&b!=1){
cout<<a*b<<" "<<b-1<<" ";
}
else if(b==1){
cout<<a<<" ";
}else if(b==0){
cout<<0;
}
}
cout<<endl;
return 0;
}