505879 ÷ 40 
Our goal is to divide 505879 by 40.

Let's proceed to step 1:
5 divided by 40 is 0 with a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Include the next digit (0) from the dividend after 5, then repeat: 50 / 40

On to step 2:
The number 40 fits into 50 1 times, leaving a remainder of 10.
Put 1 as the next digit of the answer. 
Result so far: 1.0
Subtract 40 from 50 to get 10.
Fetch the next digit (5) from the dividend, attach it to 10 and continue: 105 / 40

Let's proceed to step 3:
40 can be fit into 105 2 times, resulting in a remainder of 25.
Use 2 as the next digit of our solution. 
Result so far: 12.0
Subtract 80 from 105 to get 25.
Take the next digit (8) from the dividend and append it to 25, then repeat: 258 / 40

Going ahead to step 4:
258 divided by 40 is 6 with a remainder of 18.
The next digit of our result is 6. 
Result so far: 126.0
Deduct 240 from 258 and we're left with 18.
Bring next digit (7) of the dividend behind the 18 and repeat the process: 187 / 40

Advancing to step 5:
If we divide 187 by 40, we get 4 and a remainder of 27.
The number 4 becomes the next digit in our result. 
Result so far: 1264.0
The remainder is 27 after subtracting 160 from 187.
Grab the next digit (9) from the dividend, add it to 27, then carry on: 279 / 40

Moving on to step 6:
40 can be fit into 279 6 times, resulting in a remainder of 39.
Use 6 as the next digit of our solution. 
Result so far: 12646.0
If we subtract 240 from 279, we get 39.
Since there are no more digits in the dividend, we add a zero to the remainder making it 390, and continue the process.

On to step 7:
If we divide 390 by 40, we get 9 and a remainder of 30.
Put 9 as the next digit of the answer. 
Result so far: 12646.9
If we subtract 360 from 390, we get 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Moving on to step 8:
When dividing 300 by 40, we get 7 with a remainder of 20.
Use 7 as the next digit of our solution. 
Result so far: 12646.97
If we take 280 away from 300, we end up with 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

On to step 9:
40 can be fit into 200 5 times, resulting in a remainder of 0.
Use 5 as the next digit of our solution. 
Result so far: 12646.975
The remainder is 0 after subtracting 200 from 200.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Advancing to step 10:
When dividing 0 by 40, we get 0 with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 12646.975
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.

Advancing to step 11:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 12646.975
If we subtract 0 from 0, we get 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 outcome is 12646.975, with a leftover of 0.0.