• + 0 comments

    Pretty good, but one test case failed. Changing

    if((q+1)<=N) a[q+1]-=sum;

    to

    if((q+1)<=N + 1) a[q+1]-=sum;

    gets passed test case 1.