
Write an implementation of the Banker's Algorithm in PYTHON. If the input state is not a "safe state", your algorithm should say this. If it is a safe state, your algorithm should print a "safe sequence" of processes that we can execute, going from safe state to safe state, until all the processes have terminated. The input to your program should be the data we discussed in lectures - the matrices C,A,R and F. C and A are (n×m) while R and F are (1×m). Cij is the total amount of resource j that is needed by process i. Aij is the amount of resource j that is currently allocated to process i. Ri is the total amount of resource i in the system, while Fi is the amount of resource i that is free/available. You can assume all the numbers in C,A,R,F are non-negative integers. Please read in the data from the user: C and A can be read in as a "list of lists" while R and F are read in each as a list. Test your program, and report your result on the states defined by the following two sets of data: 1. R=[6,4,7,5],F=[3,1,1,1],C=[[3,3,2,2],[1,2,3,4],[1,3,5,0]],A=[[1,2,2,1],[1,0,3,3],[1,2,1,0]]. 2. R=[3,13,11],F=[1,5,2],C=[[0,0,1],[1,7,5],[2,3,5],[0,6,5]],A=[[0,0,1],[1,0,0],[1,3,5],[0,6,3]].