CF366C Dima and Salad

题目描述

有 $n$ 个水果,每个水果有两个属性:美味值和卡路里值。现在选用若干个(至少 $1$ 个)水果制作一份特殊的沙拉,沙拉的美味值为所选的水果的美味值的和,沙拉的卡路里值为所选水果的卡路里值的和。沙拉的美味值恰好是卡路里值的 $K$ 倍。请计算该沙拉美味值最大为多少。

输入格式

输出格式

说明/提示

In the first test sample we can get the total taste of the fruits equal to 18 if we choose fruit number 1 and fruit number 2, then the total calories will equal 9. The condition ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF366C/ce55a230ecc0a3ebd10e969b3c18a14fbf3f32d3.png) fulfills, that's exactly what Inna wants. In the second test sample we cannot choose the fruits so as to follow Inna's principle.