You are viewing a single comment's thread. Return to all comments →
def workbook(n, k, arr): sp = 0 page = 0 for i in range(n): page += 1 for j in range(1, arr[i]+1): if (j == page): sp += 1 if (j % k == 0 and j!=arr[i]): page += 1 return sp n, k = map(int, input().split()) arr = list(map(int, input().split())) result = workbook(n, k, arr) print(result)
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 →
for Python3 Platform