Alex takes the entire Komputer Kids Klub onto a field trip through time and space. Being all smart and powerful, Alex leads the club into the time machine he invented. However, since Alex is also a procrastinator, he waited until the last second, finishing the time machine just minutes before the club starts, not leaving him enough time to figure out how to make the machine work efficiently.
Alex's time machine works by jumping forward and back through time in regular intervals. For example, the time machine can be configured to jump in intervals of 4 days, which means the time machine is able to travel forward 4 days with at least 1 jump, travel forward 8 days with at least 2 jumps, or travel backward 16 days with at least 4 jumps.
Obviously tired from the hard work put into making the time machine, Alex asks you to help him determine the optimal interval to use to get to the destination time.
His time machine has This is not the best time for a trip.
.
Input Specification
The first line of the input will contain two integers
The next line will contain
Output Specification
Output an integer This is not the best time for a trip.
if the destination is unreachable.
Sample Input 1
5 -10
1 2 3 4 5
Sample Output 1
2
Explanation 1
With the interval
Sample Input 2
2 10
3 7
Sample Output 2
This is not the best time for a trip.
Comments
I tried doing this in Python and got ValueError, and then I did the exact same code in C++ and got AC on everything. I have no clue what's going on.
Its 10:30 and I'm tired why am I getting WA on only one test case >:(
komputer kids klubs 🤔
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.