func main() var n: int :: cui@inputInt() var m: int :: cui@inputInt() var p: int :: cui@inputInt() var q: int :: cui@inputInt() var ans: int :: n / ((12 + q) * m) * 12 do n :% ((12 + q) * m) if(n <> 0) for month(1, 12) do ans :+ 1 do n :- m * ((p <= month & month < p + q) ?(2, 1)) if(n <= 0) break month end if end for end if do cui@print("\{ans}\n") end func