We're dividing 876785 by 40 
We want to figure out the number of times 876785 can be divided by 40.

Moving on to step 1:
If we divide 8 by 40, we get 0 and a remainder of 8.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we subtract 0 from 8, we get 8.
Grab the next digit (7) from the dividend, add it to 8, then carry on: 87 / 40

Step 2:
If we divide 87 by 40, we get 2 and a remainder of 7.
Write down 2 as next digit of the result. 
Result so far: 2.0
If we take 80 away from 87, we end up with 7.
Append the next digit (6) from the dividend to 7 and continue with: 76 / 40

Let's proceed to step 3:
If we divide 76 by 40, we get 1 and a remainder of 36.
The next digit of our result is 1. 
Result so far: 21.0
Subtract 40 from 76 to get 36.
Take the next digit (7) from the dividend and append it to 36, then repeat: 367 / 40

Let's proceed to step 4:
367 divided by 40 is 9 with a remainder of 7.
Put 9 as the next digit of the answer. 
Result so far: 219.0
Subtract 360 from 367 to get 7.
Take the next digit (8) from the dividend and append it to 7, then repeat: 78 / 40

Advancing to step 5:
The number 40 fits into 78 1 times, leaving a remainder of 38.
The number 1 becomes the next digit in our result. 
Result so far: 2191.0
If we subtract 40 from 78, we get 38.
Take the next digit (5) from the dividend and append it to 38, then repeat: 385 / 40

Moving on to step 6:
40 goes into 385 9 times with a remainder of 25.
Write down 9 as next digit of the result. 
Result so far: 21919.0
If we take 360 away from 385, we end up with 25.
Since there are no more digits in the dividend, we add a zero to the remainder making it 250, and continue the process.

Going ahead to step 7:
If we divide 250 by 40, we get 6 and a remainder of 10.
Use 6 as the next digit of our solution. 
Result so far: 21919.6
Subtract 240 from 250 to 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 8:
100 divided by 40 is 2 with a remainder of 20.
Record the quotient 2 as the next digit in the result. 
Result so far: 21919.62
Subtract 80 from 100 to get 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Advancing to step 9:
When dividing 200 by 40, we get 5 with a remainder of 0.
The number 5 becomes the next digit in our result. 
Result so far: 21919.625
If we take 200 away from 200, we end up with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Going ahead to step 10:
40 goes into 0 0 times with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 21919.625
Deduct 0 from 0 and we're left with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Step 11:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 21919.625
The remainder is 0 after subtracting 0 from 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

The final result is 21919.625 with a remainder of 0.0.