判断一个数是否能用两个数组合得到

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/usr/bin/python
def CanCombin(A,B,num):
    ret = ()
    for i in range(1,num/A):
        print i
        lest = num - i*A;
        if lest < B:
            return ()
        if (num - i*A)%B == 0:
            bx = (num -i*A)/B
            ret = (i,bx)
            return ret;
    return ret;
a = 4
b = 5
c = 153
if __name__ == '__main__':
    print CanCombin(a,b,c)