You are viewing a single comment's thread. Return to all comments →
def workbook(n, k, arr): book=[] ans=0 for i in range(n): for h in range(arr[i]//k): book.append(list(range(h*k+1,h*k+k+1))) if arr[i]%k!=0: book.append(list(range((arr[i]//k)*k+1,arr[i]+1))) print(book) for d in range(len(book)): if d+1 in book[d]: ans+=1 return ans
Seems like cookies are disabled on this browser, please enable them to open this website
Lisa's Workbook
You are viewing a single comment's thread. Return to all comments →