Subcase 1 : if there is at least one free core then assign this task to that core at a cost of 1 unit .
if truecount < n : NEW_LINE INDENT cost += 1 NEW_LINE truecount += 1 NEW_LINE isRunning [ ele ] = True NEW_LINE DEDENT