|
|
back to boardWA 2 py 3.6 n, k =map(int, input().split(' ')) z=0 time=0 num = 1 progress = 2 if k==1 and n==1: print(n) elif k ==1: print(n-1) elif k>=n: time+=1 while num<n: num+=progress progress*=2 time+=1 print(time) else: time+=1 while z==0: if progress<=k and num<n: num+=progress progress*=2 time+=1 else: z+=1 progress=k if num<n: while num<n: if num<n: time+=1 num+=progress print(time) Edited by author 16.04.2019 01:34 |
|
|