I came up with the following problem but I am not able to find a solution for it.
Statement:
There are N wine glasses. Each wine glass is assumed to have infinite capacity. The amount of wine in each glass is a positive non-zero integer, where the unit is ml. A move of type-1 is defined as transfer of one ml from glass i to glass j. A move of type-2 is defined as discarding of one ml from glass i. All moves of type-1 have a cost of one. All moves of type-2 have a cost of k. Given the initial amount of wine in each glass, we need to make some moves of the two kinds to ensure that the amount of wine in each glass is a prime number(or zero). Print the minimum cost for such a transformation.
How to tackle this problem? Any ideas for a possible solution?