Write program implementation to manage memory using variable partitioning