You and your K - 1 friends want to attend N World Cup matches, and there are two ticket options: Normal Ticket and Special Ticket. The goal is to find the minimum total cost to watch all matches.
Example 1:
Input:3 2\n1510\n3715
Output:27
Example 2:
Input:5 3
10152058
Output:null
Constraints:
1 <= N <= 10^5
1 <= K <= 10^3
1 <= a[i] <= 10^6
1 <= b[i] <= 10^9
solution.cpp
Loading...
Run code to see test results
00:00 / 69:42
Minimum Total Cost to Watch Matches
MediumMed•390 views
You and your K - 1 friends want to attend N World Cup matches, and there are two ticket options: Normal Ticket and Special Ticket. The goal is to find the minimum total cost to watch all matches.