#include <iostream>
using namespace std;
int main() {
try {
int a, b;
cout << "Enter two integers: ";
if (!(cin >> a >> b)) throw invalid_argument("Invalid input");
if (b == 0) throw runtime_error("Division by zero");
cout << "Result: " << a / b << endl;
} catch (exception &e) {
cout << "Error: " << e.what() << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICB0cnkgewogICAgICAgIGludCBhLCBiOwogICAgICAgIGNvdXQgPDwgIkVudGVyIHR3byBpbnRlZ2VyczogIjsKICAgICAgICBpZiAoIShjaW4gPj4gYSA+PiBiKSkgdGhyb3cgaW52YWxpZF9hcmd1bWVudCgiSW52YWxpZCBpbnB1dCIpOwogICAgICAgIGlmIChiID09IDApIHRocm93IHJ1bnRpbWVfZXJyb3IoIkRpdmlzaW9uIGJ5IHplcm8iKTsKICAgICAgICBjb3V0IDw8ICJSZXN1bHQ6ICIgPDwgYSAvIGIgPDwgZW5kbDsKICAgIH0gY2F0Y2ggKGV4Y2VwdGlvbiAmZSkgewogICAgICAgIGNvdXQgPDwgIkVycm9yOiAiIDw8IGUud2hhdCgpIDw8IGVuZGw7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=