Let's divide 511982 by 40
Our goal is to divide 511982 by 40.

Let's proceed to step 1:
The number 40 fits into 5 0 times, leaving a remainder of 5.
Put 0 as the next digit of the answer. 
Result so far: 0.0
Deduct 0 from 5 and we're left with 5.
Fetch the next digit (1) from the dividend, attach it to 5 and continue: 51 / 40

Step 2:
When dividing 51 by 40, we get 1 with a remainder of 11.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
Subtracting 40 from 51 leaves us with 11.
Include the next digit (1) from the dividend after 11, then repeat: 111 / 40

Moving on to step 3:
40 goes into 111 2 times with a remainder of 31.
The next digit of our result is 2. 
Result so far: 12.0
Subtract 80 from 111 to get 31.
Bring next digit (9) of the dividend behind the 31 and repeat the process: 319 / 40

Going ahead to step 4:
When dividing 319 by 40, we get 7 with a remainder of 39.
Put 7 as the next digit of the answer. 
Result so far: 127.0
Subtracting 280 from 319 leaves us with 39.
Take the next digit (8) from the dividend and append it to 39, then repeat: 398 / 40

Moving on to step 5:
The number 40 fits into 398 9 times, leaving a remainder of 38.
Use 9 as the next digit of our solution. 
Result so far: 1279.0
Deduct 360 from 398 and we're left with 38.
Grab the next digit (2) from the dividend, add it to 38, then carry on: 382 / 40

On to step 6:
When dividing 382 by 40, we get 9 with a remainder of 22.
The number 9 becomes the next digit in our result. 
Result so far: 12799.0
Subtract 360 from 382 to get 22.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

Moving on to step 7:
40 can be fit into 220 5 times, resulting in a remainder of 20.
Use 5 as the next digit of our solution. 
Result so far: 12799.5
Deduct 200 from 220 and we're left 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.

Moving on to step 8:
40 goes into 200 5 times with a remainder of 0.
The next digit of our result is 5. 
Result so far: 12799.55
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.

After the division, we end up with 12799.55 and a remainder of 0.0.