There are $$$n$$$ kids standing in a line, indexed from $$$1$$$ to $$$n$$$. Each kid $$$i$$$ has a rating $$$r_i$$$. You need to distribute cookies to these kids such that the following conditions are met:
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$), representing the number of test cases.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 100$$$), representing the number of kids.
The second line contains $$$n$$$ space-separated integers $$$r_1, r_2, \ldots, r_n$$$ ($$$1 \le r_i \le 1000$$$), representing the ratings of the kids.
For each test case, output a single integer: the minimum total number of cookies required to satisfy all conditions.
231 2 333 2 1
6 3