
struct Request {
	int process_id;   // which process has made this req
	int resource_id;  // for which resource
	int no_of_instances; // how many instances are asked for
};

int attemptSafeSequence (int M, int N, int* Allocated, int *Need, 
		int *Available, Request current_request );

// should the current request be granted? -- return 1 if safe, 0 if unsafe
// also print the safe sequence from within the call if your answer is 'safe'

// M processes, N resources

