We look at the division of 505940 by 40 
Our goal is to divide 505940 by 40.

Advancing to step 1:
40 can be fit into 5 0 times, resulting in a remainder of 5.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we take 0 away from 5, we end up with 5.
Append the next digit (0) from the dividend to 5 and continue with: 50 / 40

Let's proceed to step 2:
50 divided by 40 is 1 with a remainder of 10.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
The remainder is 10 after subtracting 40 from 50.
Grab the next digit (5) from the dividend, add it to 10, then carry on: 105 / 40

Going ahead to step 3:
105 divided by 40 is 2 with a remainder of 25.
Put 2 as the next digit of the answer. 
Result so far: 12.0
If we subtract 80 from 105, we get 25.
Append the next digit (9) from the dividend to 25 and continue with: 259 / 40

Let's proceed to step 4:
40 can be fit into 259 6 times, resulting in a remainder of 19.
The number 6 becomes the next digit in our result. 
Result so far: 126.0
If we subtract 240 from 259, we get 19.
Append the next digit (4) from the dividend to 19 and continue with: 194 / 40

Going ahead to step 5:
40 goes into 194 4 times with a remainder of 34.
Write down 4 as next digit of the result. 
Result so far: 1264.0
If we subtract 160 from 194, we get 34.
Bring next digit (0) of the dividend behind the 34 and repeat the process: 340 / 40

Moving on to step 6:
The number 40 fits into 340 8 times, leaving a remainder of 20.
Record the quotient 8 as the next digit in the result. 
Result so far: 12648.0
The remainder is 20 after subtracting 320 from 340.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Moving on to step 7:
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: 12648.5
Deduct 200 from 200 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.

Moving on to step 8:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 12648.5
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.

On to step 9:
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: 12648.5
Subtracting 0 from 0 leaves us 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.

The final result is 12648.5 with a remainder of 0.0.