public int divide(int x, int y) throws ArithmeticException {
        if(y == 0)
            throw new ArithmeticException("Divide by zero");
        int diff = subtract(x, y);

        if(diff < 0) {
            return 0;
        } else if(diff == 0) {
            return 1;
        }

        int result = 0;
        while(diff >= 0) {
            result++;
            diff = subtract(diff, y);
        }
        return result;
    }