Code: Select all
5
6
1 6 10 14 20 30
10
10 20 30 45 60 75 100 234 4546 45666
3
5 10 15
5
10 20 31 41 51
6
1 2 3 10 20 30
output:
Code: Select all
Case 1: 10
Case 2: 41120
Case 3: 6
Case 4: 12
Case 5: 11
But the judge data should contain more tricky cases. I got wa trying to solve the problem with logic. Than i ran a simple binary search simulating the scenario and got ac easily.