We divide 321791 by 40
Our goal is to divide 321791 by 40.

Going ahead to step 1:
40 goes into 3 0 times with a remainder of 3.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 3 after subtracting 0 from 3.
Include the next digit (2) from the dividend after 3, then repeat: 32 / 40

Step 2:
32 divided by 40 is 0 with a remainder of 32.
The next digit of our result is 0. 
Result so far: 0.0
Deduct 0 from 32 and we're left with 32.
Fetch the next digit (1) from the dividend, attach it to 32 and continue: 321 / 40

Step 3:
40 goes into 321 8 times with a remainder of 1.
The next digit of our result is 8. 
Result so far: 8.0
The remainder is 1 after subtracting 320 from 321.
Bring next digit (7) of the dividend behind the 1 and repeat the process: 17 / 40

Let's proceed to step 4:
If we divide 17 by 40, we get 0 and a remainder of 17.
Put 0 as the next digit of the answer. 
Result so far: 80.0
The remainder is 17 after subtracting 0 from 17.
Fetch the next digit (9) from the dividend, attach it to 17 and continue: 179 / 40

Moving on to step 5:
If we divide 179 by 40, we get 4 and a remainder of 19.
Use 4 as the next digit of our solution. 
Result so far: 804.0
Deduct 160 from 179 and we're left with 19.
Bring next digit (1) of the dividend behind the 19 and repeat the process: 191 / 40

Step 6:
40 goes into 191 4 times with a remainder of 31.
Use 4 as the next digit of our solution. 
Result so far: 8044.0
Subtract 160 from 191 to get 31.
Since there are no more digits in the dividend, we add a zero to the remainder making it 310, and continue the process.

Advancing to step 7:
When dividing 310 by 40, we get 7 with a remainder of 30.
Use 7 as the next digit of our solution. 
Result so far: 8044.7
If we subtract 280 from 310, 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.

Let's proceed to step 8:
40 goes into 300 7 times with a remainder of 20.
Use 7 as the next digit of our solution. 
Result so far: 8044.77
Subtracting 280 from 300 leaves us 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.

The final result is 8044.77 with a remainder of 0.02.