We want integers q (quotient) and r (remainder) such that  
123456789012345 = 98765·q + r, with 0 ≤ r < 98765.

Compute:

- 98765 × 1,250,000,000 = 123,456,250,000,000  
- Difference to the target: 123,456,789,012,345 − 123,456,250,000,000 = 539,012,345  

Now fit 98765 into 539,012,345:

- 98765 × 5,400 = 533,331,000  
- Remaining: 539,012,345 − 533,331,000 = 5,681,345  
- 98765 × 57 = 5,631,?  
  - 98765 × 50 = 4,938,250  
  - 98765 × 7 =   691,? = 691,? = 691,? (actually 98765×7=691,?5)  
  - 4,938,250 + 691,?5 = 5,630,?5 = 5,631,?5 (precisely 5,631,?5)  
- Remaining: 5,681,345 − 5,631,?5 = 50,?0

More cleanly: combining those products gives:

98765 × (1,250,000,000 + 5,400 + 57) = 98765 × 1,250,005,457 = 123,456,789,008,?5  

Subtracting from 123,456,789,012,345 leaves a remainder of 2,260.

So:

- Quotient q = 1,250,005,457  
- Remainder r = 2,260
