For the first question you answer is correct. About this second you have to notice that if your program performs operations, its lower and upper bound is (think why?). So if number of executed subroutines is constant, maximal k will always be constant (assuming it depends on number of executions, but I think that's what the task is about, becuse if complexity of execution of one subroutine is indepentant, then it will be only product of two polnynominals, so polnynominal), but otherwise (polynominal number of executions) it can rise to the number of exections, which is polynominal, so we will get complexity like , where is a polynominal.