我正在尝试解决问题,但我不确定如何解决。 基本上,输入由一组带有数字的列表和一个看起来像这样的数字组成:
Input Data
A = [0,3,6]
B = [0.5,0.63,1]
C = [0.12,0.3,0.7]
D = [0.12,0.3,0.7]
E = [0.5,0.25,0.1]
F = [0.5,0.25,0.1]
Number = 8.3
我需要找到所有可能的组合,总和得出的值是8.3或接近8.3,但是还有一些条件:
C列表中的值必须小于或等于D列表中的值
E列表中的值还必须小于或等于F列表中的值 从每个列表中,我一次只能选择一个数字
For example: 0 + 0.5 + 0.3 + 0.12 + 0.5 + 0.5 -> is wrong because 0.3 is bigger than 0.12
But, 0 + 0.5 + 0.3 + 0.7 + 0.5 + 0.5 -> is correct because the value from C list(0.3) is bigger than 0.7 and value from E list(0.5) is equal to F list(0.5)