import java.util.*;
class Dynamic
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int mem,np,i,j,mp;
System.out.println("Enter the available memory:");
mem=sc.nextInt();
System.out.println("Enter no of processes:");
np=sc.nextInt();
i=0;
do