Untitled

 avatar
unknown
python
3 years ago
473 B
8
Indexable
D = 150
n = 4
a = [15, 25, 35, 25]
d = [1, 2, 1, 2]
t = [0.8, 0.8, 0.8, 0.8]
S = 12
# Solution
b = [13, 21, 29, 22]


def checkVaccine(D):
    i = 0
    sum = 0
    for e in b:
        sum += e*d[i]
        if e < a[i]*t[i]:
            print("False")
            return
        i += 1
    if sum > D:
        print("False")
        return
    if D-sum > S:
        print("False")
        return
    print("True")
    return


checkVaccine(D)
Editor is loading...