SSPUer wants to rent an apartment on Jinhai Road near SSPU. There are n apartments that are numbered from 1 to n and are arranged in a row. Two apartments are adjacent if their indices differ by 1. Some of the apartments can already be inhabited, others are available for rent.
SSPUer often visits his neighbors, so apartment is good for him if it is available for rent and there is at least one already inhabited apartment adjacent to it. SSPUer knows that there are exactly k already inhabited apartments, but he doesn't know their indices yet.
Find out what could be the minimum possible and the maximum possible number of apartments that are good for SSPUer.