Let's divide 5077 by 31
Our goal is to divide 5077 by 31.

Going ahead to step 1:
When dividing 5 by 31, we get 0 with a remainder of 5.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
The remainder is 5 after subtracting 0 from 5.
Bring next digit (0) of the dividend behind the 5 and repeat the process: 50 / 31

On to step 2:
If we divide 50 by 31, we get 1 and a remainder of 19.
Put 1 as the next digit of the answer. 
Result so far: 1.0
If we subtract 31 from 50, we get 19.
Include the next digit (7) from the dividend after 19, then repeat: 197 / 31

Let's proceed to step 3:
31 goes into 197 6 times with a remainder of 11.
Write down 6 as next digit of the result. 
Result so far: 16.0
The remainder is 11 after subtracting 186 from 197.
Bring next digit (7) of the dividend behind the 11 and repeat the process: 117 / 31

On to step 4:
31 can be fit into 117 3 times, resulting in a remainder of 24.
Put 3 as the next digit of the answer. 
Result so far: 163.0
Deduct 93 from 117 and we're left with 24.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

On to step 5:
31 can be fit into 240 7 times, resulting in a remainder of 23.
The number 7 becomes the next digit in our result. 
Result so far: 163.7
If we subtract 217 from 240, we get 23.
Since there are no more digits in the dividend, we add a zero to the remainder making it 230, and continue the process.

Moving on to step 6:
If we divide 230 by 31, we get 7 and a remainder of 13.
The next digit of our result is 7. 
Result so far: 163.77
If we subtract 217 from 230, we get 13.
Since there are no more digits in the dividend, we add a zero to the remainder making it 130, and continue the process.

The final outcome is 163.77, with a leftover of 0.013.