Consider the minimum possible answer. Since you have to do all $$$s$$$ problems in $$$n$$$ days, you can do $$$\lfloor \frac s n \rfloor$$$ in some of them and then $$$\lceil \frac s n \rceil$$$ in the rest of the days. Thus, $$$\lceil \frac s n \rceil$$$ is the minimum possible $$$a_n$$$.
Now it would be great if the function that tells if some $$$x$$$ can be the number of problems during the last day was monotonous for all $$$x$$$ from $$$\lceil \frac s n \rceil$$$ to $$$\infty$$$. So that function first returns true for some prefix of values, then it returns false. Intuitively, it sounds monotonous: the smaller values allow a lot of freedom for the construction and the larger values fail because they require too many problems in total.
The difficulty rises from the fact we not only have to prove that, but we also have to find a way to ask the result of that function quickly.
If we didn't have to, the proof would not be too hard.
ProofConsider some distribution of $$$s$$$ problems such that the last element is $$$x>\lceil \frac s n \rceil$$$. Let's move some problems around to make the last element $$$x-1$$$. So there is a block of days with $$$x$$$ problems at the end. There also is a block of days with the number of problems equal to the first day. You can always move the problem from the first day of the ending block to the last day of the beginning block.
Let's call the first day of the ending block $$$r$$$ and the last day of the beginning block $$$l$$$. Observe that the condition between $$$r-1$$$ and $$$r$$$ never breaks. Since the difference between $$$a_{r-1}$$$ and $$$a_r$$$ decreased, if it was two-fold or less then it's still two-fold or less. Same for $$$l$$$ and $$$l+1$$$. In the case of $$$l=r-1$$$, the difference between $$$a_l$$$ and $$$a_r$$$ must have been at least $$$2$$$, thus, $$$a_l \le a_r$$$ after the move. The difference can't be $$$1$$$ because then it is exactly the same construction we have built for the minimum case, thus $$$x=\lceil \frac s n \rceil$$$. The condition between $$$r$$$ and $$$r+1$$$ also can't break. If $$$r$$$ is the last day, then there is no $$$r+1$$$. Otherwise, $$$a_r$$$ becomes equal to $$$a_{r+1} - 1$$$. Since all the values are positive, that difference can't become above two-fold. Same reasoning goes for $$$l$$$ and $$$l-1$$$.
So that move is always valid. That move also decreases the size of the ending block by $$$1$$$. Thus, at some point the ending block will be of size $$$1$$$, so making a move from it will decrease the last value by $$$1$$$. That proves that for any $$$x$$$ that can be the last value, $$$x-1$$$ can also be the last value. Thus, the function is indeed monotonous.
Now that we are absolutely sure that the function is monotonous, let's change our approach.
Obviously, we should try binary search on $$$x$$$. So we have the total number of problems $$$s$$$, the number of days $$$n$$$ and some fixed number of problems during the last day $$$x$$$.
Our second educated guess can be of the following kind. Given fixed $$$n$$$ and $$$x$$$, all the possible values of $$$s$$$ that can correspond to some construction are some segment of integers. That can actually be proven in the similar manner.
ProofConsider the smallest value of $$$s$$$ that can be obtained: the last day has $$$x$$$ problems, the second to last has $$$\lceil \frac x 2 \rceil$$$ and so on.
In any construction there is a block of days with the number of problems equal to the first day. You can always add a problem to the last day of that block, thus increasing the total number of problems by $$$1$$$. The casework is basically the same as in the first proof.
That construction also implies that the smallest value of $$$s$$$ grows as $$$x$$$ grows.
So we can binary search for a solution for $$$x$$$ from $$$\lceil \frac s n \rceil$$$ to $$$s$$$. $$$f(x)$$$ can be the smallest total number of problems such that there exists a distribution. Since that value is monotonous, you can look for the largest $$$x$$$ such that $$$f(x) \le s$$$.
To calculate the function you can observe that the sequence $$$x$$$, $$$\lceil \frac x 2 \rceil$$$, $$$\left\lceil \frac{\lceil \frac x 2 \rceil}{2} \right\rceil$$$, $$$\dots$$$ has only ones after $$$\log(x)$$$ values.
Overall complexity: $$$O(\log^2 s)$$$ per testcase.