from itertools import cycle
from operator import sub
a = [2,1,2,3,2,3,4,3,4,5,4,5]
b = [1,0,1]
r = list(map(sub, a, cycle(b)))
print(r)
ZnJvbSBpdGVydG9vbHMgaW1wb3J0IGN5Y2xlCmZyb20gb3BlcmF0b3IgaW1wb3J0IHN1YgoKCmEgPSBbMiwxLDIsMywyLDMsNCwzLDQsNSw0LDVdCmIgPSBbMSwwLDFdCnIgPSBsaXN0KG1hcChzdWIsIGEsIGN5Y2xlKGIpKSkKcHJpbnQocikK
[1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]