1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 int n, e; 7 bool flag = false; 8 while (cin >> n >> e) 9 { 10 if (n*e) 11 { 12 if (flag) 13 cout << " "; 14 cout << n*e << " " << e - 1; 15 flag = true; 16 } 17 } 18 if (!flag) 19 cout << "0 0" << endl; 20 21 //system("pause"); 22 return 0; 23 }