Skip to content

Instantly share code, notes, and snippets.

@lifez
Created April 9, 2013 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lifez/5343407 to your computer and use it in GitHub Desktop.
Save lifez/5343407 to your computer and use it in GitHub Desktop.
def chk_hit(do,d):
i=0
hit=0
while d!=0:
if d%do ==0 and dragon[d-1]==1 :
hit+=1
dragon[d-1]=0
d-=1
return hit
k = int(raw_input())
l = int(raw_input())
m = int(raw_input())
n = int(raw_input())
d = int(raw_input())
dragon = []
x =0
hit = 0
while x<d:
dragon.append(1)
x+=1
hit+=chk_hit(k,d)
hit+=chk_hit(l,d)
hit+=chk_hit(m,d)
hit+=chk_hit(n,d)
print hit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment