Arbitrary Precision Integer Division We will be implementing division for arbitrarily large integers.
This is code-golf.
The task is to write a program or function that implements arbitrary precision integers and Division on them.
Note that many things that might make this very easy are disallowed, please make sure to read through the spec.
Input
You will be given 2 things as input:

a string of base 10 digits, call it \$n\$.
another string of base 10 digits, call it \$m\$

Assume that \$n&gt;m&gt;0\$ meaning that you will never be asked to divide by zero.
Output
You will output two numbers, \$Q\$ and \$R\$ where \$m\times Q+R=n\$ and \$0 \leq R &lt; m\$
Specifications

Your submission should work for arbitrarily large integers (limited by available memory).

You may not use external libraries. If you need an external library for i/o, you may treat it as a built-in. (looking at things like iostream, etc).

If your language has a built-in that trivializes this, you may not use it. This includes (but may not be limited to) built-in types that can handle arbitrary precision integers.

If a language for some reason uses arbitrary precision integers by default, this functionality cannot be used to represent integers that could not be typically stored in a 64 bits.

Input and output MUST be in base 10. It does not matter how you store the numbers in memory or how you perform arithmetic on them, but i/o will be base 10.

You have 15 Seconds to output a result. This is to prohibit iterated subtraction.

The goal here is to actually implement arbitrary precision integers. If for some reason you are able to adhere to the challenge specs and successfully do this without implementing them, well I guess good for you, sounds valid.


Test Cases

In this case, inputs are \$39!\$ and \$30!\$

Input
n = 20397882081197443358640281739902897356800000000 
m = 265252859812191058636308480000000

Output
Q = 76899763100160
R = 0


n is the sum of all factorials up to 50, plus 1. m is concatenated numbers up to 20.

input
n = 31035053229546199656252032972759319953190362094566672920420940313
m = 1234567891011121314151617181920

output
q = 25138393324103249083146424239449429
r = 62459510197626865203087816633


n is 205! + 200!. m is how many tears PeterTaylor has made me shed by tearing apart things I post in the sandbox.

Input
n = 271841734957981007420619769446411009306983931324177095509044302452019682761900886307931759877838550251114468516268739270368160832305944024022562873534438165159941045492295721222833276717171713647977188671055774220331117951120982666270758190446133158400369433755555593913760141099290463039666313245735358982466993720002701605636609796997120000000000000000000000000000000000000000000000000
m = 247

Output
q = 1100573825740813795225181252819477770473619155158611722708681386445423816849801159141424129060075102231232666057768175183676764503262931271346408394876267875141461722640873365274628650676808557279259873162169126398101692109801549256156915750794061370041981513180387019893765753438422927286098434193260562682052606153857091520795991080960000000000000000000000000000000000000000000000000
r = 0;

I'll probably add more test cases at some point.
Related
Sounds related, but really isn't
Java 8, 485 bytes
Could reduce by another 5 bytes naming the function d instead of divide or another 16 bytes if not counting class-definition.

public class G{int l(String a){return a.length();}String s(String n,String m){while(l(n)&gt;l(m))m=0+m;String a=&quot;&quot;;for(int c=1,i=l(n);i&gt;0;c=c/10){c=n.charAt(--i)+c-m.charAt(i)+9;a=c%10+a;}return e(a);}String e(String a){return a.replaceAll(&quot;^0+(?=[0-9])&quot;,&quot;&quot;);}String divide(String n,String m){String q=&quot;&quot;,p=q,y;for(int b=0,i=0;b&lt;=l(n);i--){y=n.substring(0,b);if(l(y)==l(p)&amp;&amp;p.compareTo(y)&lt;=0||l(y)&gt;l(p)){y=s(y,p);n=y+n.substring(b);q+=i;b=l(y)+1;i=10;p=m+0;}p=s(p,m);}return e(q)+&quot;,&quot;+n;}}

Can be used like this:
public static void main(String[] args) {
    G devision = new G();
    System.out.println(devision.divide(&quot;20397882081197443358640281739902897356800000000&quot;,
            &quot;265252859812191058636308480000000&quot;));
    System.out.println(devision.divide(&quot;31035053229546199656252032972759319953190362094566672920420940313&quot;,
            &quot;1234567891011121314151617181920&quot;));
    System.out.println(devision.divide(
            &quot;271841734957981007420619769446411009306983931324177095509044302452019682761900886307931759877838550251114468516268739270368160832305944024022562873534438165159941045492295721222833276717171713647977188671055774220331117951120982666270758190446133158400369433755555593913760141099290463039666313245735358982466993720002701605636609796997120000000000000000000000000000000000000000000000000&quot;,
            &quot;247&quot;));
}

yielding
76899763100160,0
25138393324103249083146424239449429,62459510197626865203087816633
1100573825740813795225181252819477770473619155158611722708681386445423816849801159141424129060075102231232666057768175183676764503262931271346408394876267875141461722640873365274628650676808557279259873162169126398101692109801549256156915750794061370041981513180387019893765753438422927286098434193260562682052606153857091520795991080960000000000000000000000000000000000000000000000000,0

Ungolfed:
public class ArbitraryPrecisionDivision {

    /**
     * Length of String
     */
    int l(String a) {
        return a.length();
    }

    /**
     * substract m of n; n &gt;= m
     */
    String s(String n, String m) {
        while (l(n) &gt; l(m))
            m = 0 + m;
        String a = &quot;&quot;;
        for (int c = 1, i = l(n); i &gt; 0; c = c / 10) {
            c = n.charAt(--i) + c - m.charAt(i) + 9;
            a = c % 10 + a;
        }
        return e(a);
    }

    /**
     * trim all leading 0s
     */
    String e(String a) {
        return a.replaceAll(&quot;^0+(?=[0-9])&quot;, &quot;&quot;);
    }

    /**
     * divide n by m returning n/m,n%m; m may not start with a 0!
     */
    String divide(String n, String m) {
        // q stores the quotient, p stores m*i, y are the b leading digits of n
        String q = &quot;&quot;, p = q, y;
        for (int b = 0, i = 0; b &lt;= l(n); i--) {
            y = n.substring(0, b);
            if (l(y) == l(p) &amp;&amp; p.compareTo(y) &lt;= 0 || l(y) &gt; l(p)) {
                y = s(y, p);
                n = y + n.substring(b);
                q += i;
                b = l(y) + 1;
                i = 10;
                p = m + 0;
            }
            p = s(p, m);
        }
        return e(q) + &quot;,&quot; + n;
    }

    public static void main(String[] args) {
        ArbitraryPrecisionDivision division = new ArbitraryPrecisionDivision();
        System.out.println(division.divide(&quot;20397882081197443358640281739902897356800000000&quot;,
                &quot;265252859812191058636308480000000&quot;));
        System.out.println(division.divide(&quot;31035053229546199656252032972759319953190362094566672920420940313&quot;,
                &quot;1234567891011121314151617181920&quot;));
        System.out.println(division.divide(
                &quot;271841734957981007420619769446411009306983931324177095509044302452019682761900886307931759877838550251114468516268739270368160832305944024022562873534438165159941045492295721222833276717171713647977188671055774220331117951120982666270758190446133158400369433755555593913760141099290463039666313245735358982466993720002701605636609796997120000000000000000000000000000000000000000000000000&quot;,
                &quot;247&quot;));
    }
}

I sacrificed a bit of speed by not precalculating an array with m times 1 through 9 and starting with b=0 instead of b=l(m), but saved lots of bytes doing so. If you are interested in arbitrary precision addition see a previous version.
I guess this will not be the shortest solution, but maybe it gives a good start.