Hello I have faced this problem in one of codeforces contest and now I have this problem in the last codechef contest.In this problem when I used ceil funtion it gives me WA ,here.But when I ignore ceil funtion and add 1 if not divisible then it’s AC,here.Here in the ceil function when I am dividing the number I take (double) value of the number so that it can ceil the number.What’s wrong with my approach?And is there anything to do with time complexity here?

Similar problem I faced before-

problem Wrong Answer Accepted

Thank you.