• + 0 comments

    This is such a needlessly confusing problem. Here are some corrections/clarifications for those that might be confused:

    1. any two consecutive stones' numbers differ by one of two values

      This part is very misleading. "Differ" makes it sound like the values can either increase or decrease from one stone to the next, but they only increase.

    2. int n: the number of non-zero stones

      This is just completely wrong. Actually, n is the total number of stones, including the zero stone.

    3. The first line contains an integer T, the number of test cases.

      Take special note of this. The input format is very confusing because each test case can actually be multiple test cases.