Skip to main content
deleted 4 characters in body
Source Link
Chas Brown
  • 9.8k
  • 1
  • 14
  • 39

Python 2, 53 bytes

lambda a:reduce(lambda b,v:b+[b[-1]/v*v+v],a,[0])[1:] 

Try it online!

k*x>y implies k>y/x; so the smallest k can be is k=floor(y/x)+1. Since in Python 2.7, integer division is already taken as floor, we want k=y/x+1, and k*x = (y/x+1)*x = y/x*x+x.

Python 2, 53 bytes

lambda a:reduce(lambda b,v:b+[b[-1]/v*v+v],a,[0])[1:] 

Try it online!

Python 2, 53 bytes

lambda a:reduce(lambda b,v:b+[b[-1]/v*v+v],a,[0])[1:] 

Try it online!

k*x>y implies k>y/x; so the smallest k can be is k=floor(y/x)+1. Since in Python 2.7, integer division is already taken as floor, we want k=y/x+1, and k*x = (y/x+1)*x = y/x*x+x.

deleted 4 characters in body
Source Link
Chas Brown
  • 9.8k
  • 1
  • 14
  • 39

Python 2, 5553 bytes

lambda a:reduce(lambda b,v:b+[v*(b[b+[b[-1]/v+1)]v*v+v],a,[0])[1:] 

Try it online!Try it online!

Python 2, 55 bytes

lambda a:reduce(lambda b,v:b+[v*(b[-1]/v+1)],a,[0])[1:] 

Try it online!

Python 2, 53 bytes

lambda a:reduce(lambda b,v:b+[b[-1]/v*v+v],a,[0])[1:] 

Try it online!

Source Link
Chas Brown
  • 9.8k
  • 1
  • 14
  • 39

Python 2, 55 bytes

lambda a:reduce(lambda b,v:b+[v*(b[-1]/v+1)],a,[0])[1:] 

Try it online!