508450 divided by 40 
Let's see how many times 40 fits into 508450.

Advancing to step 1:
When dividing 5 by 40, we get 0 with a remainder of 5.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Subtract 0 from 5 to get 5.
Append the next digit (0) from the dividend to 5 and continue with: 50 / 40

Step 2:
40 can be fit into 50 1 times, resulting in a remainder of 10.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
Deduct 40 from 50 and we're left with 10.
Bring next digit (8) of the dividend behind the 10 and repeat the process: 108 / 40

Step 3:
108 divided by 40 is 2 with a remainder of 28.
Write down 2 as next digit of the result. 
Result so far: 12.0
Subtract 80 from 108 to get 28.
Append the next digit (4) from the dividend to 28 and continue with: 284 / 40

Step 4:
284 divided by 40 is 7 with a remainder of 4.
The next digit of our result is 7. 
Result so far: 127.0
If we subtract 280 from 284, we get 4.
Bring next digit (5) of the dividend behind the 4 and repeat the process: 45 / 40

Let's proceed to step 5:
If we divide 45 by 40, we get 1 and a remainder of 5.
Write down 1 as next digit of the result. 
Result so far: 1271.0
Deduct 40 from 45 and we're left with 5.
Append the next digit (0) from the dividend to 5 and continue with: 50 / 40

Let's proceed to step 6:
When dividing 50 by 40, we get 1 with a remainder of 10.
Use 1 as the next digit of our solution. 
Result so far: 12711.0
Subtract 40 from 50 to get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Step 7:
The number 40 fits into 100 2 times, leaving a remainder of 20.
The next digit of our result is 2. 
Result so far: 12711.2
The remainder is 20 after subtracting 80 from 100.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Let's proceed to step 8:
When dividing 200 by 40, we get 5 with a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 12711.25
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.

Advancing to step 9:
0 divided by 40 is 0 with a remainder of 0.
The next digit of our result is 0. 
Result so far: 12711.25
Subtract 0 from 0 to 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.

Advancing to step 10:
40 can be fit into 0 0 times, resulting in a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 12711.25
If we take 0 away from 0, 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.

The final outcome is 12711.25, with a leftover of 0.0.