Fixed queries for counting extensions an cilcods with costs