Recursive Subsequence-II : Problem with constraints

In the question it is given that:
1 <= m <= n <= 10^18

However, in one test case

1

1 1

1 1

1000000000000000000 1234567

value of m = 1000000000000000000 & n = 1234567.

Isn’t this an error in test case? Or is there any other way to go about it?

@vkth constraint for m are that m <= 10^18 so how is m = 10^18 a problem?

Yes. But isn’t m<=n according to the constraint? So value of n should be greater than that of m.

@vkth are you sure you copied the input correctly? the last line is supposed to have 3 integers, m, n and p as input
also the first line of each test case indicates the number of elements and if it is 1 then how can there be input for 2 elements in the next 2 lines?

Okay. So i have not posted the entire test case. Since my code was failing, I downloaded them all and found out these values of m and n in one of the test case & for these values code was failing.
Yes, these are correct values of m & n.

1
1 1
1 1 1000000000000000000 1234567

@vkth again i dont think this is correct because last line should have 3 input values and this has 4. If you consider the first 3 values then no constraints are broken.

Input Format

On the first row there is the number C of test cases (equal to about 50). Each test contains four lines, k : number of elements of © and (b) (1 <= k <= 15) b1,…,bk : k natural numbers where 0 <= bj <= 109 separated by spaces c1,…,ck : k natural numbers where 0 <= cj <= 109 separated by spaces m, n, p : natural numbers separated by spaces (1 <= m <= n <= 10^18, 1<= p <= 10^8)

So,there should be 4 lines in the file in case there is only one test case.In the test cases available online there are these lines only.
If we consider first three values, Its not possible as the number of elements for b and c are 1.

testCase

@vkth if m > n then there cant be a am + am+1 + am+2 + … + an so according to me it should not be computed at all. If the output is something else then the test case might be wrong.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Yes, its a faulty test case. Caused me lot of confusion.
Thank you. :slight_smile:

1 Like