Let's divide 312366 by 40
Let's see how many times 40 fits into 312366.

Advancing to step 1:
The number 40 fits into 3 0 times, leaving a remainder of 3.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtract 0 from 3 to get 3.
Grab the next digit (1) from the dividend, add it to 3, then carry on: 31 / 40

Advancing to step 2:
The number 40 fits into 31 0 times, leaving a remainder of 31.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 31 after subtracting 0 from 31.
Append the next digit (2) from the dividend to 31 and continue with: 312 / 40

Let's proceed to step 3:
The number 40 fits into 312 7 times, leaving a remainder of 32.
Use 7 as the next digit of our solution. 
Result so far: 7.0
The remainder is 32 after subtracting 280 from 312.
Take the next digit (3) from the dividend and append it to 32, then repeat: 323 / 40

Advancing to step 4:
The number 40 fits into 323 8 times, leaving a remainder of 3.
The number 8 becomes the next digit in our result. 
Result so far: 78.0
If we take 320 away from 323, we end up with 3.
Take the next digit (6) from the dividend and append it to 3, then repeat: 36 / 40

Let's proceed to step 5:
40 can be fit into 36 0 times, resulting in a remainder of 36.
Write down 0 as next digit of the result. 
Result so far: 780.0
Deduct 0 from 36 and we're left with 36.
Fetch the next digit (6) from the dividend, attach it to 36 and continue: 366 / 40

Step 6:
366 divided by 40 is 9 with a remainder of 6.
Record the quotient 9 as the next digit in the result. 
Result so far: 7809.0
Subtract 360 from 366 to get 6.
Since there are no more digits in the dividend, we add a zero to the remainder making it 60, and continue the process.

Step 7:
If we divide 60 by 40, we get 1 and a remainder of 20.
Record the quotient 1 as the next digit in the result. 
Result so far: 7809.1
Deduct 40 from 60 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:
If we divide 200 by 40, we get 5 and a remainder of 0.
Write down 5 as next digit of the result. 
Result so far: 7809.15
If we subtract 200 from 200, 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.

Let's proceed to step 9:
0 divided by 40 is 0 with a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 7809.15
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.

On to step 10:
0 divided by 40 is 0 with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 7809.15
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.

In conclusion, the division gives 7809.15 with a balance of 0.0.