Given a ribbon of length n and a set of allowed piece sizes, cut the ribbon into the maximum number of pieces where every piece length is in the set. Return that maximum count, or -1 if the ribbon cannot be cut exactly. The input is JSON {n, sizes}.
Input: JSON {n, sizes}.
Output: Integer — the maximum number of pieces, or -1.
Input: {"n":5,"sizes":[2,3,5]}
Output: 2
Explanation: Cut into 2 and 3.Input: {"n":5,"sizes":[4,6]}
Output: -1
Explanation: Cannot cut exactly.Input: {"n":7,"sizes":[2,5]}
Output: 2
Explanation: Cut into 2 and 5.1<=n<=10001<=sizes<=100