I am having trouble debugging my program for the problem found here: https://cses.fi/problemset/task/1667/
For example, testing 2 1 1 2 gives a runtime error and I ha