[submission:https://codeforces.net/contest/1082/problem/F]
Hi. I will explain my approach to solve this hard and counter-intuitive problem.
The problem
You've got some telephone numbers. Each number is dialed a given amount of times. You would need to do an amount of key presses to dial all numbers, that is well defined. However there is an amount of special buttons that can be used to type several digits at once. The buttons can only be used at the start of a number (before manually typing anything). Buttons presses does not count as digit press. Buttons can only be used once per number. You need to decide how to place k buttons to minimize total digit presses.
** First insight **
We need to build a trie structure of the numbers, this will allow us to exploit numbers that have something in common