We look at the division of 40687147 by 123 
Let's see how many times 123 fits into 40687147.

Step 1:
4 divided by 123 is 0 with a remainder of 4.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 4, we get 4.
Include the next digit (0) from the dividend after 4, then repeat: 40 / 123

Step 2:
The number 123 fits into 40 0 times, leaving a remainder of 40.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 40 after subtracting 0 from 40.
Take the next digit (6) from the dividend and append it to 40, then repeat: 406 / 123

Let's proceed to step 3:
When dividing 406 by 123, we get 3 with a remainder of 37.
Use 3 as the next digit of our solution. 
Result so far: 3.0
If we take 369 away from 406, we end up with 37.
Include the next digit (8) from the dividend after 37, then repeat: 378 / 123

On to step 4:
When dividing 378 by 123, we get 3 with a remainder of 9.
Record the quotient 3 as the next digit in the result. 
Result so far: 33.0
The remainder is 9 after subtracting 369 from 378.
Fetch the next digit (7) from the dividend, attach it to 9 and continue: 97 / 123

Advancing to step 5:
When dividing 97 by 123, we get 0 with a remainder of 97.
The number 0 becomes the next digit in our result. 
Result so far: 330.0
Deduct 0 from 97 and we're left with 97.
Bring next digit (1) of the dividend behind the 97 and repeat the process: 971 / 123

Moving on to step 6:
If we divide 971 by 123, we get 7 and a remainder of 110.
The next digit of our result is 7. 
Result so far: 3307.0
Subtracting 861 from 971 leaves us with 110.
Include the next digit (4) from the dividend after 110, then repeat: 1104 / 123

Step 7:
123 goes into 1104 8 times with a remainder of 120.
The number 8 becomes the next digit in our result. 
Result so far: 33078.0
The remainder is 120 after subtracting 984 from 1104.
Grab the next digit (7) from the dividend, add it to 120, then carry on: 1207 / 123

Step 8:
When dividing 1207 by 123, we get 9 with a remainder of 100.
Put 9 as the next digit of the answer. 
Result so far: 330789.0
If we take 1107 away from 1207, we end up with 100.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1000, and continue the process.

On to step 9:
123 can be fit into 1000 8 times, resulting in a remainder of 16.
The next digit of our result is 8. 
Result so far: 330789.8
If we take 984 away from 1000, we end up with 16.
Since there are no more digits in the dividend, we add a zero to the remainder making it 160, and continue the process.

Advancing to step 10:
123 can be fit into 160 1 times, resulting in a remainder of 37.
Write down 1 as next digit of the result. 
Result so far: 330789.81
The remainder is 37 after subtracting 123 from 160.
Since there are no more digits in the dividend, we add a zero to the remainder making it 370, and continue the process.

Moving on to step 11:
The number 123 fits into 370 3 times, leaving a remainder of 1.
The number 3 becomes the next digit in our result. 
Result so far: 330789.813
Subtract 369 from 370 to get 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

On to step 12:
10 divided by 123 is 0 with a remainder of 10.
Write down 0 as next digit of the result. 
Result so far: 330789.813
If we subtract 0 from 10, we get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Step 13:
100 divided by 123 is 0 with a remainder of 100.
Write down 0 as next digit of the result. 
Result so far: 330789.813
Deduct 0 from 100 and we're left with 100.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1000, and continue the process.

The final outcome is 330789.813, with a leftover of 0.0001.