Arrays

3.6

18 votes
Ad-Hoc, Data Structures, Heaps, Medium, Trees, 普通-難しい
Problem

Note that time limit has been increased to 3 sec

Mike has 3 arrays a,b,c of length n and a number k. He wants to find minimal value of

over all non-negative integer values of t.

The first line contains two numbers n and k ().

Each of the next n lines contains 3 numbers - ().

Output the minimal value achievable.

Time Limit: 3
Memory Limit: 256
Source Limit:
Explanation

For we have that and this is the minimal value we chan achieve.

Editor Image

?