human
Area of plot remaining at the end | Function to return the area of the remaining plot.
Continue while plot has positive area and there are persons left.
If length > breadth then subtract breadth from length.
Else subtract length from breadth.
Driver code"
How can the above be solved in Python?

Give me a code to area of plot remaining at the end and the other steps required?
assistant
#Here is code to area of plot remaining at the end and the other steps required.
 def remainingArea ( N , M , K ) :
	while ( K > 0 and N > 0 and M > 0 ) :
		if ( N > M ) :
			N = N - M ;
		else :
			M = M - N ;
		K = K - 1 ;
	if ( N > 0 and M > 0 ) :
		return N * M ;
	else :
		return 0 ;
N = 5 ;
M = 3 ;
K = 2 ;
print ( remainingArea ( N , M , K ) ) ;