Created
April 9, 2013 06:29
-
-
Save lifez/5343407 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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