you give problemset consist n problem the difficulty ith problem a_i it guarantee difficulty distinct give increase orderyou assemble contest consist problem give problemset in word contest assemble subset problem necessary consecutive give problemset there condition satisfied problem hard problem maximum difficulty problem difficulty great difficulty problem great twice difficulty problem in word let a_i_1 a_i_2 dot a_i_p difficulty select problem increase order then j 1 p1 a_i_j 1 le a_i_j cdot 2 hold it mean contest consist problem validAmong contest satisfy condition assemble maximum number problem your task find number problem