#include
using namespace std;
int division(int a, int b) {
int sign = 1;
int c = 0;
if (a < 0 && b < 0) {
a *= -1;
b *= -1;
} else if (a < 0) {
sign = -1;
a *= -1;
} else if (b < 0) {
sign = -1;
b *= -1;
}
while (a >= b) {
++c;
a -= b;
}
return c * sign;
}
int remainder(int a, int b) {
if (a < 0) a *= -1;
if (b < 0) b *= -1;
while (a >= b) a -= b;
return a;
}
int main() {
int a, b;
while (1) {
cout << ">>> ";
cin >> a >> b;
cout << a << " / " << b << " = " << division(a, b) << '\n';
cout << a << " % " << b << " = " << remainder(a, b) << '\n';
}
}