NINJA7 - TWO SEQUENCES PROBLEM
Given two lists and having the same length, find the length of longest subsequence of list , whose sum is greater than or equal to the corresponding subsequence of list . Corresponding subsequence means indices chosen in both of the lists must be the same.
The first line contains an integer T , the number of test cases.
Then for each test cases, there are 3 lines.
The first line has an integer N, the number of elements in the lists A& B.
The second line contains N integers of the list A.
The third line contains N integers of the list B.
For each test case, print the answer in a single line.
100 100 5
2 2 1000
got so many WAs just because forgot to use long long...
Thanks to author, nice problem!Last edit: 2016-02-27 08:29:44
@lazan_037, output 0 if there is not subsequence like that.
What if there is not subsequence like that?